grimoire icon indicating copy to clipboard operation
grimoire copied to clipboard

Constantly being logged out and no media is loading

Open WolfwithSword opened this issue 1 year ago • 2 comments

Describe the bug I currently have this setup in Unraid with the latest grimoire container and associated pocketbase container. I'm accessing everything locally currently before exposing out with a reverse proxy on a domain.

I'm getting a few issues which I think might be related. The first and primary issue is that I am constantly being logged out of Grimoire every few minutes. To the point where if I log in and click to create a new category, by the time I've named it and selected a colour, there is a 50% chance I've been logged out and it doesn't add.

Additionally, sometimes when it logs me out, I am still able to see all my user's categories on the left side even though I am not logged in. If I leave the "login" page open for a few minutes before logging in, it immediately signs me out again.

I should note that the extension does keep me logged in.

Second issue is no images/media are loading from the bookmarks I do have added. I've checked the paths and compared to the files in the pocketbase instance's volumes and they do exist.

Anytime an action is taken place in Grimoire, the following log is produced:

TypeError: fetch failed
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GET (file:///app/build/server/chunks/_server.ts-z21KZ-VH.js:6:20)
    at async render_endpoint (file:///app/build/server/index.js:391:20)
    at async resolve2 (file:///app/build/server/index.js:3661:22)
    at async Object.handle (file:///app/build/server/chunks/hooks.server--1Uz_Y0W.js:32:20)
    at async respond (file:///app/build/server/index.js:3555:22)
    at async Array.ssr (file:///app/build/handler.js:1243:3) {
  [cause]: Error: connect ECONNREFUSED 127.0.0.1:8090
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 8090
  }
}

The pocketbase URL I have set in the environment variables is http://pocketbase:80 as I have both containers in the same docker network. However, the logs keep saying it is using "localhost:8090" for the pocketbase url, though this did work for the initial setup of my bookmarks until I started having the login issue about 30 min after first using it.

I have reinstalled both containers a couple times and still getting these issues. Additionally in trying to get the screenshot below of the missing media, the logging out behaviour worsened and it logs me out immediately upon logging in now.

To Reproduce Steps to reproduce the behavior:

  1. Grimoire & Pocketbase containers setup in unraid. Pocketbase URL setup as internal docker network host name/port. Grimoire accessed via Unraid host IP and external port.
  2. Log in with new user (non-admin)
  3. Use app for more than a couple minutes
  4. User is logged out.
  5. Log back in, add some bookmarks. View media is not loading.

Expected behavior I expect to stay logged in for a longer period of time, for my categories to not be visible if my user is logged out, and for images to load.

Screenshots

image image image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Opera GX, Edge, Firefox
  • Version: (All three up to date as of 2024-05-25)

Additional context I have checked on two different devices and different browsers, so I can rule out a caching or cookie issue with the login or media.

WolfwithSword avatar May 25 '24 21:05 WolfwithSword

I've been having this same issue for the past month, I've tried so many things but still nothing. Running on Docker on a raspberry pi.

Edit: looking for a solution, I found that adding network_mode: "host" to grimoire helps with the database error, but still keeps randomly login me out all the time... Not an ideal solution at all, I'm afraid...

phampyk avatar May 27 '24 01:05 phampyk

I'm aware of this bug and tried to fix it twice, but was unsuccessful. This is one of the reasons I've chosen to rewrite the core parts of the app to focus on simplicity and performance.

I don't know how much time it will take to get there, and I hope you will understand. Rest assured, it will be fixed - I'm using every chance I get to proceed with the work on this.

goniszewski avatar Jun 09 '24 19:06 goniszewski

Please upgrade to the latest version of Grimoire. You can use the integrated migration tool to transfer your data to new format.

goniszewski avatar Sep 24 '24 16:09 goniszewski