imagegenius / docker-semaphore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't login with username/password set in the env

TristanDeKegel opened this issue · comments

Hi,
so I'm trying to install semaphore using your docker image but I can't seem to get it working: I've set up the DB connection (using Postgres 15 running in another docker) but I can't seem to login on the 'main' page using the admin/password I've setup with the docker environment variables.

When I enter 'semaphore user list' in the docker's console this is what I get:

Could not decode configuration!
panic: read /config: is a directory

goroutine 1 [running]:
github.com/ansible-semaphore/semaphore/util.decodeConfig({0x21b3e60?, 0xc0001a65d8})
        /go/src/github.com/ansible-semaphore/semaphore/util/config.go:236 +0xdf
github.com/ansible-semaphore/semaphore/util.loadConfig({0x0?, 0xc0001fd860?})
        /go/src/github.com/ansible-semaphore/semaphore/util/config.go:195 +0x127
github.com/ansible-semaphore/semaphore/util.ConfigInit({0x0?, 0xc000223160?})
        /go/src/github.com/ansible-semaphore/semaphore/util/config.go:145 +0x25
github.com/ansible-semaphore/semaphore/cli/cmd.createStore({0x0, 0x0})
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/root.go:92 +0x3b
github.com/ansible-semaphore/semaphore/cli/cmd.glob..func12(0x25d2960?, {0xb96f17?, 0x0?, 0x0?})
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/user_list.go:17 +0x45
github.com/spf13/cobra.(*Command).execute(0x25d2960, {0x260f3c0, 0x0, 0x0})
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x25d21e0)
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:902
github.com/ansible-semaphore/semaphore/cli/cmd.Execute()
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/root.go:36 +0x5b
main.main()
        /go/src/github.com/ansible-semaphore/semaphore/cli/main.go:8 +0x17
commented

set SEMAPHORE_CONFIG_PATH=/config/config.json in your docker/compose/command/...

i would think that SEMAPHORE_CONFIG_PATH is a path not a file... but that seems to fix the issue temporarily till i do some investigating on what that variable does

you need to append the config location to any semaphore command: semaphore user list --config /config/config.json,

as to why you cant login, ill try recreate your enviroment and see if i can replicate

Same issue.

Unable to run the new password or new admin user commands without error either.
Fresh install on unraid, docker.

semaphore user change-by-login --login admin --password blah --config ./config.json

panic: no rows in result set

goroutine 1 [running]:
github.com/ansible-semaphore/semaphore/cli/cmd.glob..func8(0x25d3ae0?, {0xb96f17?, 0x6?, 0x6?})
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/user_change.go:75 +0x2b8
github.com/spf13/cobra.(*Command).execute(0x25d3ae0, {0xc000082120, 0x6, 0x6})
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x25d21e0)
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:902
github.com/ansible-semaphore/semaphore/cli/cmd.Execute()
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/root.go:36 +0x5b
main.main()
        /go/src/github.com/ansible-semaphore/semaphore/cli/main.go:8 +0x17

semaphore user change-by-login --login admin --password blah

Could not decode configuration!
panic: read /config: is a directory

goroutine 1 [running]:
github.com/ansible-semaphore/semaphore/util.decodeConfig({0x21b3e60?, 0xc00000e5e8})
        /go/src/github.com/ansible-semaphore/semaphore/util/config.go:236 +0xdf
github.com/ansible-semaphore/semaphore/util.loadConfig({0x0?, 0x203000?})
        /go/src/github.com/ansible-semaphore/semaphore/util/config.go:195 +0x127
github.com/ansible-semaphore/semaphore/util.ConfigInit({0x0?, 0x40?})
        /go/src/github.com/ansible-semaphore/semaphore/util/config.go:145 +0x25
github.com/ansible-semaphore/semaphore/cli/cmd.createStore({0x0, 0x0})
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/root.go:92 +0x3b
github.com/ansible-semaphore/semaphore/cli/cmd.glob..func8(0x25d3ae0?, {0xb96f17?, 0x4?, 0x4?})
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/user_change.go:69 +0x108
github.com/spf13/cobra.(*Command).execute(0x25d3ae0, {0xc00003ddc0, 0x4, 0x4})
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x25d21e0)
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /go/src/github.com/ansible-semaphore/semaphore/vendor/github.com/spf13/cobra/command.go:902
github.com/ansible-semaphore/semaphore/cli/cmd.Execute()
        /go/src/github.com/ansible-semaphore/semaphore/cli/cmd/root.go:36 +0x5b
main.main()
        /go/src/github.com/ansible-semaphore/semaphore/cli/main.go:8 +0x17

Solved: #1 (comment)
semaphore user add --admin --login oli --name Oliver --email blah@blah.bin --password wonderfulpassword --config /config/config.json