Hi all, just getting familiar with supertokens. I'...
# support-questions-legacy
s
Hi all, just getting familiar with supertokens. I've got a pretty barebones backend working locally using the Go SDK. I'm trying to deploy it up to fly.io. Everything compiles fine, but the call to
supertokens.Init()
just hangs. I'm running in debug mode, when it gets to that call it logs out all the normal stuff, but then just...sits there. Nothing after the call to init is running. Wondering if anyone else has experienced this? I got a node server running on Fly with the same configuration, so I don't think that's set up incorrectly.
r
Hey!
@sattvikc can help tomorrow
s
@SDavies I quickly tried deploying a supertokens app to fly.io. it seems to work fine. could you share ur supertokens.Init call and also the debug logs
s
I mean I can't share specifics, but here's the init:
Copy code
websiteBasePath := "/auth"
apiBasePath := "/auth"

err := supertokens.Init(supertokens.TypeInput{
        Supertokens: &supertokens.ConnectionInfo{
            ConnectionURI: os.Getenv("CORE_URI"),
        },
        AppInfo: supertokens.AppInfo{
            AppName:         "supertokens-backend",
            APIDomain:       os.Getenv("API_DOMAIN"),
            WebsiteDomain:   os.Getenv("WEBSITE_DOMAIN"),
            WebsiteBasePath: &websiteBasePath,
            APIBasePath:     &apiBasePath,
        },
        RecipeList: []supertokens.Recipe{
            thirdpartypasswordless.Init(tplmodels.TypeInput{
                FlowType: "MAGIC_LINK",
                ContactMethodEmailOrPhone: plessmodels.ContactMethodEmailOrPhoneConfig{
                    Enabled: true,
                },
                Providers: []tpmodels.TypeProvider{
                    thirdparty.Google(tpmodels.GoogleConfig{
                        ClientID:     os.Getenv("GOOGLE_CLIENT_ID"),
                        ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"),
                    }),
                    // thirdparty.Apple(tpmodels.AppleConfig{
                    //     ClientID: os.Getenv("APPLE_CLIENT_ID"),
                    //     ClientSecret: tpmodels.AppleClientSecret{
                    //         KeyId: os.Getenv("APPLE_KEY_ID"),
                    //         PrivateKey: `...`,
                    //         TeamId: os.Getenv("APPLE_TEAM_ID"),
                    //     },
                    // }),
                    thirdparty.Facebook(tpmodels.FacebookConfig{
                        ClientID:     os.Getenv("FB_APP_ID"),
                        ClientSecret: os.Getenv("FB_APP_SECRET"),
                    }),
                },
            }),
            session.Init(nil), // initializes session features
        },
    })
And here are the logs (part 1):
Copy code
2022-11-08T19:09:39.796 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "Started SuperTokens with debug logging (supertokens.Init called)", file: "github.com/supertokens/supertokens-golang@v0.9.7/supertokens/main.go:23" sdkVer: "0.9.7"}

2022-11-08T19:09:39.796 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "AppInfo: {"AppName":"supertokens-backend","WebsiteDomain":"...","APIDomain":"...","WebsiteBasePath":"/auth","APIBasePath":"/auth","APIGatewayPath":null}", file: "github.com/supertokens/supertokens-golang@v0.9.7/supertokens/main.go:23" sdkVer: "0.9.7"}

2022-11-08T19:09:39.796 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "session init: AntiCsrf: VIA_CUSTOM_HEADER", file: "github.com/supertokens/supertokens-golang@v0.9.7/recipe/session/recipe.go:112" sdkVer: "0.9.7"}

2022-11-08T19:09:39.796 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "session init: CookieDomain: nil", file: "github.com/supertokens/supertokens-golang@v0.9.7/recipe/session/recipe.go:112" sdkVer: "0.9.7"}
Part 2:
Copy code
2022-11-08T19:09:39.796 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "session init: CookieSameSite: none", file: "github.com/supertokens/supertokens-golang@v0.9.7/recipe/session/recipe.go:112" sdkVer: "0.9.7"}

2022-11-08T19:09:39.796 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "session init: CookieSecure: true", file: "github.com/supertokens/supertokens-golang@v0.9.7/recipe/session/recipe.go:112" sdkVer: "0.9.7"}

2022-11-08T19:09:39.796 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "session init: RefreshTokenPath: /auth/session/refresh", file: "github.com/supertokens/supertokens-golang@v0.9.7/recipe/session/recipe.go:112" sdkVer: "0.9.7"}

2022-11-08T19:09:39.797 app[...] sjc [info] com.supertokens {t: "2022-11-08T19:09:39Z", message: "session init: SessionExpiredStatusCode: 401", file: "github.com/supertokens/supertokens-golang@v0.9.7/recipe/session/recipe.go:112" sdkVer: "0.9.7"}
r
Can you print something right after the init call? Does it get printed out?
s
It does not
r
Can we arrange a debugging call for sometime day after? This is really strange
Also, can you try with just the session recipe init and nothing else?
So remove thirdpartypasswordless init
s
I will try that, sure
r
Thanks
s
Well while you asked me that I tried deploying to a different region on fly.io and it worked just fine. So apparently there's a problem with their network and it has nothing to do with supertokens at all. Shoot, I'm sorry to have pulled two of you into this.
It is a bit weird that it just hangs, but still, the problem is on their end
r
Sounds good! I’m glad it worked out šŸ™‚
8 Views