Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 | Error: Please specify QUIRREL_BASE_URL.. #948

Closed
jatidevelopments opened this issue Feb 4, 2022 · 8 comments
Closed

400 | Error: Please specify QUIRREL_BASE_URL.. #948

jatidevelopments opened this issue Feb 4, 2022 · 8 comments

Comments

@jatidevelopments
Copy link

Bug Report

Current Behavior
When deploying to AWS (Fargate) Quirrel doesn't seem to work. It always asks for the QUIRREL_BASE_URL when calling the queue. I tried setting the QUIRREL_BASE_URL with https:// and without.

Input Code

Queue is in path: /api/emailQueue.ts (NextJS):

export default Queue("api/emailQueue", async ({ id }, meta) => {
... 
})

Calling the queue:

emailQueue.enqueue(
          {
            id: r.data.id,
          },
          {
            retry: ["10sec", "60sec", "5min", "15min"],
          }
        )

Expected behavior/code
Pushing to the queue and don't return an error that the QUIRREL_BASE_URL isn't defined.

Environment

  • Quirrel version: 1.8.1
  • Node/npm version: Node 16

Does anybody know a solution?

@Skn0tt
Copy link
Member

Skn0tt commented Feb 4, 2022

hey @jatidevelopments! are you using the hosted Quirrel version (https://quirrel.dev), or a self-hosted instance? could you specify what "it always asks for the QUIRREL_BASE_URL" means? is that a log output you're seeing?

@jatidevelopments
Copy link
Author

Hi @Skn0tt we are using the hosted Quirrel version. We deploy on AWS. I can't see anything in the Logsoutput but it happens when I try to call the emailQueue.enqueue function it returns "400 | Error: Please specify QUIRREL_BASE_URL".

@Skn0tt
Copy link
Member

Skn0tt commented Feb 6, 2022

Hmm :/ That error is thrown by this line:

throw new Error("Please specify QUIRREL_BASE_URL.");

It seems to me that somehow your environment variables aren‘t set correctly. Can you verify that QUIRREL_BASE_URL is indeed specified? For example by logging process.env.QUIRREL_BASE_URL right before your .enqueue call.

@jatidevelopments
Copy link
Author

Okay, I will test it. Maybe it's because the env is from the Parameter Store at AWS. Do I need to add https:// in front?

@Skn0tt
Copy link
Member

Skn0tt commented Feb 7, 2022

Shouldn‘t make a difference. If there‘s no protocol given, it automatically uses https://:

return normalisedURL(baseUrl);

but specyfing the protocol also works fine.

@jatidevelopments
Copy link
Author

Screenshot 2022-02-07 at 16 03 17

Now I get this error locally after switching the import from quirrel/vercel to quirrel/blitz

@Skn0tt
Copy link
Member

Skn0tt commented Feb 7, 2022

I assume that you were able to fix the QUIRREL_BASE_URL issue.

That error looks like you specified QUIRREL_ENCRYPTION_SECRET locally, but had pending jobs that weren‘t encrypted at all. So now it‘s trying to decrypt an unencrypted payload. Could that be the case?

@jatidevelopments
Copy link
Author

I know the error
We use react-admin for the admin panel
This only works only at client side
So we disabled SSR
Quirrel cant get the QUIRREL_BASE_URL env on client-side
So yeah we need to create an API endpoint and then call the enqueue function in there

So it's solved! But thanks for the support!

@Skn0tt Skn0tt closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants