Hi All- I'm checking out SuperTokens for a React p...
# support-questions-legacy
j
Hi All- I'm checking out SuperTokens for a React project and have the ThirdPartyEmailRecipe React/Express recipe running on my mac dev machine using the hosted https://try.supertokens.com server but have been banging my head against a wall trying to get it to work with self hosted. Getting the "Error: No SuperTokens core available to query" no matter what I try. I have downloaded and installed supertokens directly on my macOS development machine, not using docker. Have the hello working in the browser. I updated the backend config.ts to use:
Copy code
js
  supertokens: {    
    // this is the location of the SuperTokens core.
    connectionURI: "http://localhost:3567",  
}
I've run supertokens both with the in memory storage
Copy code
sh
$ supertokens start
Loading supertokens config.
Completed config.yaml loading.
Loading storage layer.
Using in memory storage.
Loading supertokens version.yaml file.
Started SuperTokens on localhost:3567 with PID: 8364
And with MySQL by creating a database & user and setting up the mysql_connection_uri in config.yaml
Copy code
sh
$ supertokens start
Loading supertokens config.
Completed config.yaml loading.
Loading storage layer.
Loading MySQL config.
Loading supertokens version.yaml file.
Setting up MySQL connection pool.
Started SuperTokens on localhost:3567 with PID: 10797
The database tables were created and tested with results from
SELECT * FROM key_value;
Everything else is default setup but always get error for no supertokens core available. Switching back to try.supertokens.com works. I have started over twice and been through the instructions multiple times. Read through previous posts by searching the error here in Discord and most solutions seemed to be related to docker network issues which I am not using. The pieces all seem to be running but not talking to the local supertokens server. MacOS firewall inactive. Cors issue? Any advice on what to try next greatly appreciated!
r
hey @jypr this usually happens cause of 2 reasons: - Firewall setting preventing communication - If you are using docker for your backend process, the connection uri can't be localhost cause that would point to inside the docker container.
j
Thanks @rp_st, that is where I have been focusing but still head-banging-into-wall. Not using Docker (maybe I should try that route next) and the macOS firewall is inactive. Have shut off VPN and any metwork/monitoring I can think of. Taking a quick course in macOS networking via Google, heading down the adding custom Packet Filters rules road right now and entering unfamiliar lands... Seems I am out heading out of the SuperTokens discussion domain with this but if there are any macOS 13.3 network gurus out there, well HELP!
r
this is really strange indeed..
can i see the whole supertokens.init config on the backend?
j
Here it is , hopefully something simple?
Copy code
js
export const SuperTokensConfig: TypeInput = {
  supertokens: {
    // this is the location of the SuperTokens core.
    connectionURI: "http://localhost:3567", // works-> https://try.supertokens.com  nope -> http://localhost:3567 nope -> http://192.168.1.40:3567
  },
  appInfo: {
    appName: "SuperTokens Demo App",
    apiDomain: getApiDomain(),
    websiteDomain: getWebsiteDomain(),
  },
  // recipeList contains all the modules that you want to
  // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides
  recipeList: [
    ThirdPartyEmailPassword.init({
      providers: [
        // We have provided you with development keys which you can use for testing.
        // IMPORTANT: Please replace them with your own OAuth keys for production use.
        ThirdPartyEmailPassword.Google({
          clientId:
            "1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com",
          clientSecret: "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",
        }),
        ThirdPartyEmailPassword.Github({
          clientSecret: "e97051221f4b6426e8fe8d51486396703012f5bd",
          clientId: "467101b197249757c71f",
        }),
        ThirdPartyEmailPassword.Apple({
          clientId: "4398792-io.supertokens.example.service",
          clientSecret: {
            keyId: "7M48Y4RYDL",
            privateKey:
              "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----",
            teamId: "YWQCXGJRJL",
          },
        }),
      ],
    }),
    Session.init(),
    Dashboard.init(),
  ],
}
Here is info from network checks.
Copy code
sh
$ lsof -i TCP:3567
COMMAND   PID      USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    49863 jaypricer   54u  IPv6 0x3754407c69dee3fb      0t0  TCP localhost:emware-oft (LISTEN)
r
hmm. Seems find mostly. Im honestly not sure why it's not working.
j
forgot to add this
Copy code
sh
$ nc -vn 192.168.1.40 3567
nc: connectx to 192.168.1.40 port 3567 (tcp) failed: Connection refused
so it seems the supertokens java is listening but is being blocked by something, just not sure how to tell what as I have checked everything I can think of. @rp_st Thanks so much for looking at it. At this point I am going to give up on this direction, maybe install and try the docker setup or try it out on a different machine.
r
yeaaa. fair enough. Try running the core using docker.
Or then use our managed service.
Sorry, couldn't help much. If you can find a way to help us reproduce this issue, we can debug on our end
10 Views