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

bug: timer_wait not working and db locked errors #27

Closed
BaukeZwart opened this issue Sep 13, 2024 · 23 comments
Closed

bug: timer_wait not working and db locked errors #27

BaukeZwart opened this issue Sep 13, 2024 · 23 comments
Labels
bug Something isn't working

Comments

@BaukeZwart
Copy link

Description of the bug

Running with this in my config, but when DL multiple episodes I see every episode is being processed by Plex the moment it's imported in Sonarr.
Also the log is filled with db locked errors. (Using SQLite)

opts:
  default_timer_wait: 180 # In seconds

triggers:
  sonarr:
    type: "sonarr"
    timer:
      wait: 5 # In seconds
ERROR autopulse::service::runner: unable to delete not found events: DatabaseError(Unknown, "database is locked")
ERROR autopulse::service::runner: unable to delete failed events: DatabaseError(Unknown, "database is locked")

Steps To Reproduce

See above

Additional Information

No response

@BaukeZwart BaukeZwart added the bug Something isn't working label Sep 13, 2024
@dan-online
Copy link
Owner

Hmm, this is odd as I recently added options to prevent this on SQLite

@BaukeZwart
Copy link
Author

BaukeZwart commented Sep 16, 2024

For now I reverted to autoscan but if there is anything I can test to help please let me know.
EDIT: I see that root is the owner of the db and the shm and wal files, is that correct?

@dan-online
Copy link
Owner

For now I reverted to autoscan but if there is anything I can test to help please let me know. EDIT: I see that root is the owner of the db and the shm and wal files, is that correct?

Yep that should be correct, and the presence of those files show it should be working correctly.. I'll do some testing on my end to see

@BaukeZwart
Copy link
Author

Side note, I see you closed my earlier bug report about incorrect discord time stamp as solved.
But the issue is still there.

@dan-online
Copy link
Owner

@BaukeZwart the timestamp uses local time now, so as long as you set /etc/localtime:/etc/localtime:ro it should be correct, I'll add it to the docker-compose

@BaukeZwart
Copy link
Author

I removed that from my compose when it didn't change anything during earlier testing.
Tried again and time stamp is correct now.

@dan-online
Copy link
Owner

Could you share more logs with log_level set to debug?

@BaukeZwart
Copy link
Author

I have set log level to debug.
I will force a few imports later when my server is done with the bulk import from the seedbox and post the log.

@BaukeZwart
Copy link
Author

@dan-online dan-online mentioned this issue Sep 24, 2024
4 tasks
@dan-online
Copy link
Owner

Hey @BaukeZwart can you test if #35 i.e. danonline/autopulse:pr-35 resolves your issue?

@BaukeZwart
Copy link
Author

pulling it now, I will let you know.

@BaukeZwart
Copy link
Author

@dan-online pr-35 seems to work much better.
I still see db locked errors in the log but the delay now seems to work.
This is the debug log after adding a 3 episode mini series.
https://logs.notifiarr.com/?586f50ab99ec1076#HK7i1jjcSU1Zc8M2c5Sny55bQKho4y7M6YUB9HVcYMew

@BaukeZwart
Copy link
Author

Discord_xKaLNnHES2

@dan-online
Copy link
Owner

Hmm, I've increased the busy_timeout in the same tag, perhaps that might fix it?

@BaukeZwart
Copy link
Author

BaukeZwart commented Sep 25, 2024

That also didn't fix it.
I noticed the timestamp of the db itself never changes, it seems noting is written to it.

dopus_DLmPTPxgjk

@dan-online
Copy link
Owner

dan-online commented Sep 25, 2024

That is extremely odd, could you try deleting the folder and then starting autopulse, seems to be some weird permissions issue

@BaukeZwart
Copy link
Author

BaukeZwart commented Sep 25, 2024

I tried that yesterday, stopped the container, deleted the db file and restarted.
I will try again but would be surprised if any changes.
EDIT: I checked, none of the other containers I run that use sqlite have the db with root as owner. They all use user: ${PUID}:${PGID} as the owner. Can that be the reason?

@dan-online
Copy link
Owner

That is very possibly the reason, I originally tried having the image not be root but that led to some permissions issues so I had to go root in #18

@BaukeZwart
Copy link
Author

As a test I tried manually changing the perm and ownership of the db files and added ${PUID}:${PGID} to docker compose, but still the same db locked errors.

@dan-online
Copy link
Owner

Hmm, quite odd since I don't get these errors with example/docker-compose-sqlite.yml

@BaukeZwart
Copy link
Author

I'm using the same docker compose.
Is there anything in the config that can cause this?

@BaukeZwart
Copy link
Author

Switched to postgres and it all working fine now.

@dan-online
Copy link
Owner

I'll tentatively close this but if someone else sees this issue then feel free to comment to reopen this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants