#SSL error when using `auth.createPublicToken`

1 messages · Page 1 of 1 (latest)

raw knoll
#

Hey @full laurel,

Creating this post so we can get to the bottom of your problem.

When doing this:

const publicToken = await auth.createPublicToken({
  scopes: {
    read: {
      tasks: ["my-task-1", "my-task-2"],
    },
  },
});

You get this error: ERR_SSL_TLSV1_ALERT_INTERNAL_ERROR

#

Are you using Bun?

full laurel
#

yes, as the package manager

raw knoll
#

@maiden onyx you were right that it's Bun

maiden onyx
#

Do you require bun for your setup or can you easily check with node?

raw knoll
#

Ah no that won't help, because this is from @full laurel's backend.

maiden onyx
#

Yeah, not that. I meant running the nextjs server with node instead of nx bun

full laurel
#

let me try

full laurel
#

i'm getting the same error, i think it is also important to notice that I'm using next 15 which seems to be really buggy:

{
  error: Error [TriggerApiError]: Connection error.
      at async eval (webpack:///src/server/trpc/router/trigger.ts?9c05:12:26)
    10 |
    11 |     try {
  > 12 |       const publicToken = await auth.createPublicToken({
       |                          ^
    13 |         scopes: {
    14 |           read: {
    15 |             tags: [`entity:${entity.id}`], {
    status: undefined,
    headers: undefined,
    error: undefined,
    code: undefined,
    param: undefined,
    type: undefined,
    [cause]: TypeError: fetch failed
        at async eval (webpack:///src/server/trpc/router/trigger.ts?9c05:12:26)
      10 |
      11 |     try {
    > 12 |       const publicToken = await auth.createPublicToken({
         |                          ^
      13 |         scopes: {
      14 |           read: {
      15 |             tags: [`entity:${entity.id}`], {
      [cause]: [Error: 40F82BFA01000000:error:0A000438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1590:SSL alert number 80
      ] {
        library: 'SSL routines',
        reason: 'tlsv1 alert internal error',
        code: 'ERR_SSL_TLSV1_ALERT_INTERNAL_ERROR'
      }
    }
  }
}
maiden onyx
#

Okay, at least we know it's not that! Could you confirm if this happens on all API call to Trigger.dev? Are you able to trigger runs from your backend? If so, I'd try triggering one from the same route as above.

#

Would be great to figure out if this affects all requests or only the one for createPublicToken

full laurel
#

Ok i figure this out, it was a problem with some old env variables

#

i removed TRIGGER_API_KEY and TRIGGER_API_URL in favor of just TRIGGER_SECRET_KEY and it is working now

raw knoll
#

Ah was TRIGGER_API_URL set to https://cloud.trigger.dev?