quirrel icon indicating copy to clipboard operation
quirrel copied to clipboard

Quirrel & Blitzjs not working

Open rahmonzoda opened this issue 2 years ago • 12 comments

Bug Report

Current Behavior The event starts to execute, but in the end, api do not receive a request

Screenshot 2022-04-30 at 14 45 32

Input Code

https://github.com/rahmonzoda/quirrel-test

for demonstration, I created a new blitsjs project according to the instructions

https://docs.quirrel.dev/getting-started/next-js blitz install quirrel

I also used docker version, same result

export default Queue(
  "api/greetingsQueue", // the path of this API route
  async ({ to, message }: Greetings) => {
    console.log(`Greetings, ${to}! Thy ears shall hear: "${message}"`)
  }
)

export default async function enqueueGreeting() {
  await greetingsQueue.enqueue({
    to: "Sandy Cheeks",
    message: "Howdy!",
  })
}

Expected behavior/code console.log(Greetings, Sandy Cheeks! Thy ears shall hear: "Howdy!")

Environment

  • Quirrel version: [v1.8.1]
  • Node/npm version: [v17.9.0, npm v8.7.0]

Possible Solution

Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

rahmonzoda avatar Apr 30 '22 11:04 rahmonzoda

Taking a look :eyes:

Skn0tt avatar May 02 '22 11:05 Skn0tt

Working fine for me with your repo. Did you change Blitz' port by chance?

Screenshot 2022-05-02 at 13 41 33

Skn0tt avatar May 02 '22 11:05 Skn0tt

You're right, now it works for me too. Strange, I must be missing something important, but I don’t understand what

I need a https for testing, but I set QUIRREL_BASE_URL=https://192.168.0.13:3000

no other changes

rahmonzoda avatar May 02 '22 13:05 rahmonzoda

yeah, that could be related to it. have you tried opening that URL in the browser? I don't think the Blitz Dev server has HTTPS support

Skn0tt avatar May 02 '22 13:05 Skn0tt

I wrote my custom server. I have been writing the project for several weeks, but Quirrel installed a few days ago

rahmonzoda avatar May 02 '22 13:05 rahmonzoda

I removed custom server and use default, but still same result Screenshot 2022-05-02 at 16 26 37

what are the debugging tools for this? logs?

rahmonzoda avatar May 02 '22 13:05 rahmonzoda

In any case, thank you for the Quirrel and Blitz are excellent libraries, I'm still poking around. What is happening.

rahmonzoda avatar May 02 '22 13:05 rahmonzoda

The Quirrel server calls QUIRREL_BASE_URL + {queue}. So for this, it'd call https://192.168.0.13:3000/api/hourlyCron. You can try verifying that you can call this endpoint from the browser / via cURL.

Skn0tt avatar May 02 '22 13:05 Skn0tt

Yeah, it works if just go through browser

rahmonzoda avatar May 02 '22 13:05 rahmonzoda

that's interesting. this is the line where the executing job log you're seeing is emitted:

https://github.com/quirrel-dev/quirrel/blob/153299597118e8af30277a6c2fae09762a8fa638/src/api/worker/index.ts#L86

it should print "execution done" after the request is done:

https://github.com/quirrel-dev/quirrel/blob/153299597118e8af30277a6c2fae09762a8fa638/src/api/worker/index.ts#L143

but it looks like it's hanging somewhere between

Skn0tt avatar May 02 '22 13:05 Skn0tt

I rolled back to v14.11.0 node version and it looks like start working

version v17.9.0 still not working

rahmonzoda avatar May 02 '22 13:05 rahmonzoda

that's weird. I don't have an idea what's causing this. if you find out, let me know and I'll fix.

Skn0tt avatar May 02 '22 14:05 Skn0tt