https://supertokens.com/ logo
Title
v

Val

12/07/2022, 10:30 AM
Hi hope you guys are fine ! 🙂 First try with supertokens and seems very nice ! Facing an error with dashboard no SuperTokens core available to query
r

rp

12/07/2022, 10:31 AM
hey @Val
Have you configured the supertokens connectionURI and the api key on the backend SDK>?
v

Val

12/07/2022, 10:31 AM
I'm using docker installation with golang backend 🙂
golang
func Run(conf config.Supertokens) error {
    apiBasePath := "/auth"
    websiteBasePath := "/auth"
    return supertokens.Init(supertokens.TypeInput{
        Supertokens: &supertokens.ConnectionInfo{
            ConnectionURI: conf.Host,
            /*APIKey:        conf.APIKey,*/
        },
        AppInfo: supertokens.AppInfo{
            AppName:         conf.AppName,
            APIDomain:       conf.APIDomain,
            WebsiteDomain:   conf.WebAppDomain,
            APIBasePath:     &apiBasePath,
            WebsiteBasePath: &websiteBasePath,
        },
        RecipeList: []supertokens.Recipe{
            dashboard.Init(dashboardmodels.TypeInput{
                ApiKey: "Mypassword12345",
            }),
            emailpassword.Init(nil),
            session.Init(nil),
        },
    })
}
I thing yes and it's run before middlewares
r

rp

12/07/2022, 10:32 AM
right. Seem about fine. Whats the value of
conf.Host
?
v

Val

12/07/2022, 10:32 AM
maybe I should pass the docker host container name
r

rp

12/07/2022, 10:33 AM
is the core running on that or on http://localhost:3567?
oh yea.., if golang is also in a docker container, then you should pass the docker service name
v

Val

12/07/2022, 10:35 AM
No seem to work Question API key on both
ConnectionInfo
and
dashboard.Init
should be the same? I try both
yaml
supertokens:
    image: registry.supertokens.io/supertokens/supertokens-postgresql:4.2
    depends_on:
      - postgres
    ports:
      - "${SUPERTOKENS_PORT}:3567"
    environment:
      POSTGRESQL_USER: ${DB_USERNAME}
      POSTGRESQL_HOST: ${DB_HOST}
      POSTGRESQL_PASSWORD: ${DB_PWD}
    restart: unless-stopped
    networks:
      - postgres-net
    healthcheck:
      test: >
        bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e "GET /hello HTTP/1.1\r\nhost: 127.0.0.1:3567\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"'
      interval: 10s
      timeout: 5s
      retries: 5
SUPERTOKENS_PORT=3567
r

rp

12/07/2022, 10:37 AM
> API key on both ConnectionInfo and dashboard.Init should be the same? Not really. They don't need to be the same.
set the connectionURI in golang to
http://supertokens:3567
v

Val

12/07/2022, 10:38 AM
ok @rp just my container didn't restart properly and don't changed my .env initialisation I'm down all and re-run it
I try and tell you the result 🙂
r

rp

12/07/2022, 10:38 AM
ok
v

Val

12/07/2022, 10:44 AM
ok tried with
ConnectionURI: fmt.Sprintf("http://localhost:%d", conf.Port),
And
ConnectionURI: fmt.Sprintf("http://%s:%d", conf.Host, conf.Port),
Where conf.Host is equal to superTokens container name
and both didn't work
Oh wait I got a 200 on count but 500 on
/users
Got 500 because no user set yet?
r

rp

12/07/2022, 10:46 AM
no.. still issues connecting to the core
have you added
postgres-net
network to your golang service config?
v

Val

12/07/2022, 10:47 AM
yes and all container are run on same docker-compose
r

rp

12/07/2022, 10:47 AM
did you set the connectionURI as http://superTokens:3567 or http://supertokens:3567?
v

Val

12/07/2022, 10:48 AM
first
try the second
r

rp

12/07/2022, 10:48 AM
oh.. discord made by first option have a small t
i had actually typed superTokens
im not sure why it's not being able to connect. This seems more like a docker config issue
v

Val

12/07/2022, 10:49 AM
ok I thing I have something
s

sattvikc

12/07/2022, 10:49 AM
might be due to linking on the docker compose
r

rp

12/07/2022, 10:50 AM
hmm. So it does connect to the core
v

Val

12/07/2022, 10:50 AM
Supertokens container seem run healthy but try to /hello every 5sec and don't handle /users
weird no?
r

rp

12/07/2022, 10:51 AM
Then it might be a bug in the users get API on the backend golang SDK. Do you have a stack trace?
v

Val

12/07/2022, 10:52 AM
yes let me cleaning up my logs 🙂
I got a panic on api.UsersGet with chi router
s

sattvikc

12/07/2022, 10:57 AM
could u share the stack trace?
v

Val

12/07/2022, 10:58 AM
yes but sorry by advance I don't have the entire trace I'm trying to out it up to a file
s

sattvikc

12/07/2022, 10:59 AM
sure, m checking on my end as well. will update u soon
I think the msg u provided has the necessary info. let me get back to you
v

Val

12/07/2022, 11:01 AM
the all one btw
r

rp

12/07/2022, 1:16 PM
hey @Val
we just updated the golang SDK with a fix
please use version 0.9.11 and try again
v

Val

12/07/2022, 1:23 PM
it's already available with docker ? @rp
r

rp

12/07/2022, 1:48 PM
oh just update the golang SDK that you are using
v

Val

12/07/2022, 2:11 PM
@rp can you provide me a command to update it from inside container? I use
registry.supertokens.io/supertokens/supertokens-postgresql:4.2
r

rp

12/07/2022, 2:32 PM
you don't need to update the supertokens core
you need to update your golang container
which uses our golang sdk
v

Val

12/07/2022, 2:35 PM
ohhhh sorry I didn't understand that sorry
🔥
r

rp

12/07/2022, 2:45 PM
nice