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

Recurring bug with docker container: failed to get user: interrupted (9) #3922

Open
ozls opened this issue Sep 13, 2024 · 18 comments
Open

Recurring bug with docker container: failed to get user: interrupted (9) #3922

ozls opened this issue Sep 13, 2024 · 18 comments
Labels
bug Something isn't working need more context PR welcome Good for new contributor

Comments

@ozls
Copy link

ozls commented Sep 13, 2024

Describe the bug

Hello, I'm selfhosting memos (with sqlite db) and I have a recurring bug that I don't know how to solve. From time to time, I will get a popup saying failed to get user: interrupted (9) on the web interface. After this, the interface displays a blank page. In the logs of the docker container I get those lines:

2024/09/13 16:44:59 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to get resource: context canceled"
2024/09/13 16:44:59 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="failed to get user: interrupted (9)"
2024/09/13 16:44:59 ERROR server error method=/memos.api.v1.MemoService/ListMemoProperties error="failed to get user: interrupted (9)"
2024/09/13 16:45:00 ERROR server error method=/memos.api.v1.MemoService/ListMemos error="failed to get user: interrupted (9)"
2024/09/13 16:45:00 ERROR server error method=/memos.api.v1.MemoService/ListMemoTags error="failed to get user: interrupted (9)"
2024/09/13 16:45:07 ERROR server error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="failed to get user: interrupted (9)"
2024/09/13 16:45:07 ERROR server error method=/memos.api.v1.AuthService/GetAuthStatus error="failed to get user: interrupted (9)"

Most of the time it is solved by restarting the container, but it can be very inconvenient if I'm not home. I have no clue what triggers it.

Any idea what is the problem is? Can I do anything more to help find the root cause?

Steps to reproduce

I have no clue

The version of Memos you're using.

v0.22.5

Screenshots or additional context

No response

@ozls ozls added the bug Something isn't working label Sep 13, 2024
@RoccoSmit
Copy link
Contributor

RoccoSmit commented Sep 13, 2024

What type of resources (attachments) are you viewing? Images?
And, do you get these errors when looking at new resources (ones you haven't looked at before) or does it happen with for e.g. reload the home page?
Did you have this issue in v0.22.4?

@ozls
Copy link
Author

ozls commented Sep 13, 2024

In this case I have just one resource in the latest memos, a screenshot. I only ever attach photos or screenshots. It had been displayed before without issue, I don't know what changed. It definitely happened before 0.22.5.

@RoccoSmit
Copy link
Contributor

RoccoSmit commented Sep 13, 2024

I was wondering if the new thumbnail feature was causing this, but if it happens before 0.22.5 then it's something else

@sherlcok314159
Copy link

0.22.2 also has this problem

@RoccoSmit
Copy link
Contributor

I've not been able to reproduce this, if I had to take a stab in the dark it would be something to do with your browser telling the server to close the connection (context), the server being mid db activity and not unlocking the db and the subsequent db requests not being allowed due to the lock e.g. getting the user. but the code looks like its handling the connection closure so not sure and also not sure why your browser would tell the server to close the connection

image

Are you viewing large images?

@ozls
Copy link
Author

ozls commented Sep 14, 2024

I had this issue with both my laptop (Firefox) and my phone (Vanadium, a Chromium fork) so I don't think it comes from the browser. My images are all below 3MB.

But now that I think about it, it might have something to do with the way the container gets stopped. I run watchtower every night for updates, and before 0.22.5 I had memos on the stable tag, which means it got restarted frequently. Indeed memos has been running without issue for a few days, but I just managed to make it crash:

  1. Browse my memos a little bit, load resources without issue
  2. Stop and remove the container
  3. Start up the container
  4. Browse memos as fast as possible, as soon as the web UI was available

I managed to view a few images without issue, but one specific memos with three pictures made it crash. The images never appeared, no more memos could be loaded, the same log lines appeared and a blank screen was displayed on refresh.

Just after this I stopped, removed and started the container once more. I just waited a little bit, and then I was able to browse memos without any crash. I hope this helps!

@remsch
Copy link

remsch commented Sep 14, 2024

I share the same problem (complete overlap, in my opinion), running the container version of Memos (v.0.22.5) on Coolify v.4.0.0-beta.325. I have two separate instances on two subdomains, both on SQLite, one runs fine, while the other doesn't. The problems occurred when I added another user I since deleted. Since deletion didn't resolve the problem, I suspect another issue.

@RoccoSmit
Copy link
Contributor

@ozls do you always have the same successful web request before the first ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary or are they different

@sherlcok314159
Copy link

Any progress? You may need to upload several images (100~ kb or 2 MB+) to reproduce this problem. I tried several versions and the problem remains.

@ozls
Copy link
Author

ozls commented Sep 25, 2024

@RoccoSmit The bug did not happen since I stopped removing and restarting the container on a regular basis so I'm confident I found the trigger. Nevertheless I made it happen once more to try to answer your question. I had to click "load more" a few times, and then the the memo with three pictures made it crash again. Here is the complete log from container start to crash:


███╗   ███╗███████╗███╗   ███╗ ██████╗ ███████╗
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
---
██╔████╔██║█████╗  ██╔████╔██║██║   ██║███████╗
██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║██║   ██║╚════██║
Server profile
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
version: 0.22.5
data: /var/opt/memos
╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝ ╚═════╝ ╚══════╝
dsn: /var/opt/memos/memos_prod.db
addr: 
port: 5230
mode: prod
driver: sqlite
---
Version 0.22.5 has been started on port 5230
---
See more in:
👉Website: https://usememos.com
👉GitHub: https://github.com/usememos/memos
---
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.AuthService/GetAuthStatus
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.UserService/GetUserSetting
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.InboxService/ListInboxes
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/09/25 06:40:24 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/09/25 06:40:25 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/09/25 06:40:25 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/09/25 06:40:25 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/09/25 06:40:25 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:25 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:26 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:26 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:26 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/09/25 06:40:26 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/09/25 06:40:27 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/09/25 06:40:27 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:27 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:27 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/09/25 06:40:28 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/09/25 06:40:29 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/09/25 06:40:29 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:29 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:30 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:30 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:30 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/09/25 06:40:30 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/09/25 06:40:31 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/09/25 06:40:31 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:31 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/09/25 06:40:31 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/09/25 06:40:31 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/09/25 06:40:34 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to get resource: context canceled"
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="failed to get user: interrupted (9)"
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="failed to get user: interrupted (9)"
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to get resource: context canceled"
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to get resource: interrupted (9)"
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to get resource: context canceled"
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.MemoService/ListMemoProperties error="failed to get user: interrupted (9)"
2024/09/25 06:40:34 ERROR server error method=/memos.api.v1.MemoService/ListMemoTags error="failed to get user: interrupted (9)"
2024/09/25 06:40:37 ERROR server error method=/memos.api.v1.MemoService/ListMemos error="failed to get user: interrupted (9)"
2024/09/25 06:40:40 ERROR server error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="failed to get user: interrupted (9)"
2024/09/25 06:40:40 ERROR server error method=/memos.api.v1.AuthService/GetAuthStatus error="failed to get user: interrupted (9)"
2024/09/25 06:40:44 ERROR server error method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile error="failed to get user: interrupted (9)"
2024/09/25 06:40:44 ERROR server error method=/memos.api.v1.AuthService/GetAuthStatus error="failed to get user: interrupted (9)"

@Jofroop
Copy link

Jofroop commented Oct 1, 2024

I have the same problem. For me it seems to be triggered right after posting a memo but I'm not completely sure, as I haven't tested it enough yet. I only restart my container when this issue happens and I never move it so I don't think that that's the trigger for me.

I also get the blank page when memos stops working, the failed to get user: interrupted (9), and whenever I try to log in after this bug happens it says Failed to find user by userame <my-username>.

I've also installed Memos through Docker, and the problem persists until I restart the Docker container, and quickly returns. I'm using v0.22.5. Here are my logs when the error happens:

version: 0.22.5

███╗   ███╗███████╗███╗   ███╗ ██████╗ ███████╗
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
██╔████╔██║█████╗  ██╔████╔██║██║   ██║███████╗
██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║██║   ██║╚════██║
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝ ╚═════╝ ╚══════╝
data: /var/opt/memos
dsn: /var/opt/memos/memos_prod.db
addr:
port: 5230
mode: prod
driver: sqlite
---
Version 0.22.5 has been started on port 5230
---
See more in:
👉Website: https://usememos.com
👉GitHub: https://github.com/usememos/memos
---
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.AuthService/GetAuthStatus
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.UserService/GetUserSetting
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.UserService/GetUserAvatarBinary
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.InboxService/ListInboxes
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.UserService/ListUserAccessTokens
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:26:25 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:26:29 INFO OK method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile
2024/10/01 20:26:29 INFO OK method=/memos.api.v1.AuthService/GetAuthStatus
2024/10/01 20:26:29 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:26:29 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:26:29 INFO OK method=/memos.api.v1.UserService/GetUserSetting
2024/10/01 20:26:50 INFO OK method=/memos.api.v1.WorkspaceSettingService/SetWorkspaceSetting
2024/10/01 20:27:38 INFO OK method=/memos.api.v1.IdentityProviderService/ListIdentityProviders
2024/10/01 20:27:40 INFO OK method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile
2024/10/01 20:27:40 INFO OK method=/memos.api.v1.AuthService/GetAuthStatus
2024/10/01 20:27:40 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:27:40 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:27:40 INFO OK method=/memos.api.v1.UserService/GetUserSetting
2024/10/01 20:27:53 INFO OK method=/memos.api.v1.UserService/ListUserAccessTokens
2024/10/01 20:27:54 INFO OK method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile
2024/10/01 20:27:54 INFO OK method=/memos.api.v1.AuthService/GetAuthStatus
2024/10/01 20:27:54 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:27:54 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:27:54 INFO OK method=/memos.api.v1.UserService/GetUserSetting
2024/10/01 20:27:57 INFO OK method=/memos.api.v1.WebhookService/ListWebhooks
2024/10/01 20:28:00 INFO OK method=/memos.api.v1.UserService/ListUsers
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.WorkspaceService/GetWorkspaceProfile
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.AuthService/GetAuthStatus
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.UserService/GetUserSetting
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.UserService/GetUserAvatarBinary
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.UserService/GetUserAvatarBinary
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.InboxService/ListInboxes
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/10/01 20:28:26 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/10/01 20:31:25 INFO OK method=/memos.api.v1.InboxService/ListInboxes
2024/10/01 20:33:00 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/10/01 20:33:00 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/10/01 20:33:00 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/10/01 20:33:00 INFO OK method=/memos.api.v1.MemoService/ListMemoProperties
2024/10/01 20:33:00 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/10/01 20:33:00 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/10/01 20:33:01 INFO OK method=/memos.api.v1.MemoService/ListMemoTags
2024/10/01 20:33:01 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/10/01 20:33:01 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/10/01 20:33:01 INFO OK method=/memos.api.v1.MemoService/ListMemos
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to get resource: context canceled"
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to find memo by ID: 0x4000856790"
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="rpc error: code = Internal desc = failed to get resource: context canceled"
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="failed to get user: interrupted (9)"
2024/10/01 20:33:01 INFO OK method=/memos.api.v1.ResourceService/GetResourceBinary
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.MemoService/ListMemoProperties error="failed to get user: interrupted (9)"
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.ResourceService/GetResourceBinary error="failed to get user: interrupted (9)"
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.MemoService/ListMemoProperties error="failed to get user: interrupted (9)"
2024/10/01 20:33:01 ERROR server error method=/memos.api.v1.MemoService/ListMemoTags error="failed to get user: interrupted (9)"
2024/10/01 20:33:07 ERROR server error method=/memos.api.v1.MemoService/CreateMemo error="failed to get user: interrupted (9)"
2024/10/01 20:33:10 ERROR server error method=/memos.api.v1.MemoService/CreateMemo error="failed to get user: interrupted (9)"```

@Kellermaan
Copy link
Contributor

also get the same error
failed to get user: interrupted (9)
is it fixed now?

@Kellermaan
Copy link
Contributor

also get the same error failed to get user: interrupted (9) is it fixed now?

And when I get this error, I need to log in again.

@johnnyjoygh johnnyjoygh added PR welcome Good for new contributor need more context labels Oct 12, 2024
@RoccoSmit
Copy link
Contributor

I tried, but could not reproduce the issue on my end for debugging

@Kellermaan
Copy link
Contributor

I tried, but could not reproduce the issue on my end for debugging

you are welcomed to use my instance for debugging.

@Kellermaan
Copy link
Contributor

do we have any update on this?

@Jofroop
Copy link

Jofroop commented Oct 17, 2024

I have no evidence but I suspect it may be connected to the 'explore' page. I noticed the other day that loading it crashed the instance. However, I've been getting almost no crashes recently. Perhaps the issue mostly fixes itself after some time?

@Kellermaan
Copy link
Contributor

I have no evidence but I suspect it may be connected to the 'explore' page. I noticed the other day that loading it crashed the instance. However, I've been getting almost no crashes recently. Perhaps the issue mostly fixes itself after some time?

make sense. it look all fine until I click the explore page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more context PR welcome Good for new contributor
Projects
None yet
Development

No branches or pull requests

7 participants