Hi hope you guys are fine ! 🙂 First try with sup...
# support-questions
v
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
hey @Val
Have you configured the supertokens connectionURI and the api key on the backend SDK>?
v
I'm using docker installation with golang backend 🙂
Copy code
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
right. Seem about fine. Whats the value of
conf.Host
?
v
maybe I should pass the docker host container name
r
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
No seem to work Question API key on both
ConnectionInfo
and
dashboard.Init
should be the same? I try both
Copy code
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
> 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
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
ok
v
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
no.. still issues connecting to the core
have you added
postgres-net
network to your golang service config?
v
yes and all container are run on same docker-compose
r
did you set the connectionURI as http://superTokens:3567 or http://supertokens:3567?
v
first
try the second
r
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
ok I thing I have something
s
might be due to linking on the docker compose
r
hmm. So it does connect to the core
v
Supertokens container seem run healthy but try to /hello every 5sec and don't handle /users
weird no?
r
Then it might be a bug in the users get API on the backend golang SDK. Do you have a stack trace?
v
yes let me cleaning up my logs 🙂
I got a panic on api.UsersGet with chi router
s
could u share the stack trace?
v
yes but sorry by advance I don't have the entire trace I'm trying to out it up to a file
s
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
the all one btw
r
hey @Val
we just updated the golang SDK with a fix
please use version 0.9.11 and try again
v
it's already available with docker ? @rp
r
oh just update the golang SDK that you are using
v
@rp can you provide me a command to update it from inside container? I use
registry.supertokens.io/supertokens/supertokens-postgresql:4.2
r
you don't need to update the supertokens core
you need to update your golang container
which uses our golang sdk
v
ohhhh sorry I didn't understand that sorry
🔥
r
nice
2 Views