goniszewski / grimoire

Bookmark manager for the wizards šŸ§™
https://grimoire.pro
MIT License
1.99k stars 58 forks source link

ClientResponseError 0: The request was autocancelled. #49

Closed smetroid closed 8 months ago

smetroid commented 8 months ago

Describe the bug Docker compose starts up just fine, however as soon as you hit the web URL, I get a 500 Internal Error

To Reproduce

  1. git clone https://github.com/goniszewski/grimoire
  2. docker-compose up

Expected behavior The containers should start, and I should be able to hit the URL and view the application

Screenshots Error:

 docker-compose logs | more
/usr/lib/python3.12/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (2.0.7) or chardet (5.2.0)/charset_normalizer (3.2.0) doesn't match a supported version!
  warnings.warn(
Attaching to grimoire, grimoire-pocketbase
grimoire      | Listening on 0.0.0.0:5173
grimoire      | ClientResponseError 0: The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.
grimoire      |     at file:///app/node_modules/.pnpm/pocketbase@0.19.0/node_modules/pocketbase/dist/pocketbase.es.mjs:1:31144
grimoire      |     at async load (file:///app/build/server/chunks/0-546e495e.js:32:24)
grimoire      |     at async load_server_data (file:///app/build/server/index.js:1186:18)
grimoire      |     at async file:///app/build/server/index.js:2557:18 {
grimoire      |   url: '',
grimoire      |   status: 0,
grimoire      |   response: {},
grimoire      |   isAbort: true,
grimoire      |   originalError: DOMException [AbortError]: This operation was aborted
grimoire      |       at fetch (file:///app/build/shims.js:20346:13)
grimoire      |       at async load (file:///app/build/server/chunks/0-546e495e.js:32:24)
grimoire      |       at async load_server_data (file:///app/build/server/index.js:1186:18)
grimoire      |       at async file:///app/build/server/index.js:2557:18
grimoire      | }

image

Desktop (please complete the following information):

goniszewski commented 8 months ago

Hello @smetroid, thank you for adding this issue!

Looks like on startup, the app tries to execute multiple similar, or exact even, requests to PocketBase API and gets rejected. I will try to reproduce this behavior tomorrow to better understand it and will post my findings here.

goniszewski commented 8 months ago

Hello again @smetroid and @llagerlof - during my testing, I was able to reproduce your issue and commit a hotfix (https://github.com/goniszewski/grimoire/commit/2900182479f5d82a14d6d18b661fa79952d2bdcc) that resolved this issue.

Please use the latest version on the main branch, or pull the Docker image again after it is made and try once more.

llagerlof commented 8 months ago

@goniszewski Thank you. Although that fix didn't work for me, the behavior of the problem has changed. Now the page attempts to load for some seconds (exactly 45 seconds. before the fix, the error was raised instantly when trying to access the page). At this point, the page opens with an error 500, and the terminal starts logging errors:

grimoire-pocketbase  | 2024/01/24 11:59:18 Server started at http://0.0.0.0:80
grimoire-pocketbase  | ā”œā”€ REST API: http://0.0.0.0:80/api/
grimoire-pocketbase  | ā””ā”€ Admin UI: http://0.0.0.0:80/_/
grimoire             | Listening on 0.0.0.0:5173
grimoire             | ClientResponseError 0: Something went wrong while processing your request.
grimoire             |     at file:///app/node_modules/.pnpm/pocketbase@0.19.0/node_modules/pocketbase/dist/pocketbase.es.mjs:1:31144
grimoire             |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
grimoire             |     at async load (file:///app/build/server/chunks/0-0983a6e7.js:32:24)
grimoire             |     at async load_server_data (file:///app/build/server/index.js:1186:18)
grimoire             |     at async respond_with_error (file:///app/build/server/index.js:2215:27)
grimoire             |     at async resolve (file:///app/build/server/index.js:3573:16)
grimoire             |     at async Object.handle (file:///app/build/server/chunks/hooks.server-6da8a1ec.js:31:20)
grimoire             |     at async respond (file:///app/build/server/index.js:3404:22)
grimoire             |     at async Array.ssr (file:///app/build/handler.js:1221:3) {
grimoire             |   url: '',
grimoire             |   status: 0,
grimoire             |   response: {},
grimoire             |   isAbort: false,
grimoire             |   originalError: TypeError: fetch failed
grimoire             |       at fetch (file:///app/build/shims.js:20346:13)
grimoire             |       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
grimoire             |       at async load (file:///app/build/server/chunks/0-0983a6e7.js:32:24)
grimoire             |       at async load_server_data (file:///app/build/server/index.js:1186:18)
grimoire             |       at async respond_with_error (file:///app/build/server/index.js:2215:27)
grimoire             |       at async resolve (file:///app/build/server/index.js:3573:16)
grimoire             |       at async Object.handle (file:///app/build/server/chunks/hooks.server-6da8a1ec.js:31:20)
grimoire             |       at async respond (file:///app/build/server/index.js:3404:22)
grimoire             |       at async Array.ssr (file:///app/build/handler.js:1221:3) {
grimoire             |     cause: Error: connect EADDRNOTAVAIL 127.0.0.1:5173 - Local (0.0.0.0:0)
grimoire             |         at internalConnect (node:net:1090:16)
grimoire             |         at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
grimoire             |         at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1481:9)
grimoire             |         at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:130:8) {
grimoire             |       errno: -99,
grimoire             |       code: 'EADDRNOTAVAIL',
grimoire             |       syscall: 'connect',
grimoire             |       address: '127.0.0.1',
grimoire             |       port: 5173
grimoire             |     }
grimoire             |   }

<goes forever>
goniszewski commented 8 months ago

@llagerlof Looks like its failing to reach the PocketBase instance. Can you provide a value for the PUBLIC_POCKETBASE_URL variable?

Example: http://localhost:8090

llagerlof commented 8 months ago

It was empty. I put in the default value http://localhost:8090, just in case, but the same problem persists. Let's wait for feedback from @smetroid to see if the fix solved for him.

goniszewski commented 8 months ago

For now, I have reverted the changes that introduced the usage of proxy for making PocketBase calls. I will reintroduce it after some fixing.

smetroid commented 8 months ago

@goniszewski the latest changes appear to have fixed the original issue I was having, the site comes up now, thank you for the fix.

I had to remove the image and container from my system ... starting over from scratch.

image

llagerlof commented 8 months ago

Well, I assume there's some specific incompatibility with my environment. You can close this issue if you wish.

smetroid commented 8 months ago

Closing this ticket, the latest master updates have fixed the original issue encountered.