Require.js :138 | and | Database is locked

In relation to the following post:

/t/require-js-138-uncaught-error-load-timeout-for-modules-api-series/1022

Sonarr is more or less unusable to me. I’ve got a Qnap TS870-Pro, running firmware 4.1.3

Sonar has been installed and updated to the latest Master release.

However, after only a couple of days trying to get Sonarr to work, it seems to be completely useless.

After a mere 2-5 minutes of running, Sonarr seems to enter a completely unresponsive state. I get the 5 dot loading icon and it hangs there. If I refresh the page, I get the grey screen with the dotted loading gif, and nothing more.

It’s not until I restart Sonar and Mono on my qnap, in a particular order, that I can gain access to Sonarr.

Attached is my Trace Log: http://pastebin.com/6sDyHeWE

The errors I see are:

Require.js :138 Uncaught Error: Load timeout for modules: api!series

and in the log I see:

15-3-6 14:11:07.5|Trace|Owin|
15-3-6 14:11:07.5|Trace|Owin|SQLite error (5): database is locked
15-3-6 14:11:07.5|Trace|Owin|

15-3-6 14:11:07.5|Trace|Owin|
15-3-6 14:11:07.5|Trace|Owin|SQLite error (5): database is locked
15-3-6 14:11:07.5|Trace|Owin|

15-3-6 14:11:07.5|Trace|Owin|
15-3-6 14:11:07.5|Trace|Owin|SQLite error (5): database is locked
15-3-6 14:11:07.5|Trace|Owin|

Sonarr doesn’t have a separate process, it runs through mono. What are the two processes you need to terminate?

Sonarr uses DB locks pretty sparingly and they are short lived, some initial thoughts are its a problem with sqlite and how it was compiled or something is locking the database on disk and preventing it from being updated. Besides the locks I didn’t see anything else abnormal.

Which version of Sonarr, mono and sqlite are installed?

On my Qnap, I have to power down both Mono and Sonarr, then launch Mono first, then Sonarr in order to get it back online.

I’m not sure how to check my sqlite version, but here is the other info requested.


About
Version
2.0.0.2850
Mono Version
3.10.0 (tarball Mon Oct 27 19:35:18 CET 2014)
AppData directory
/share/homes/admin/.config/NzbDrone
Startup directory
/share/MD0_DATA/.qpkg/Sonarr/Sonarr


Here is the source post from where I got Sonarr for Qnap, if this helps you:
http://forum.qnap.com/viewtopic.php?p=454974&sid=dde2e1eea31c0079acacc801e57a332b#p454974

[QPKG] Sonarr (Nzbdrone)
Postby goormans » Sun Jan 11, 2015 8:11 am

[Name]
Sonarr (NzbDrone)

[Description]
Smart PVR for newsgroup and bittorrent users

[Version]
Sonarr: 2.0.0.2594 Updating via web-intergface
QPKG: 150111

[Resource]
https://sonarr.tv/

[Dependencies]
Depends on Mono Install Mono from Qpkg
sqlite3
mediainfo

[Download]
Sonarr QPKG: Download Sonarr V150111 qpkg for all QNAP series

[Remarks]
thanks to MrK for al his work! i only repacked it in the new Sonarr version.

The package itself works on ARM and x86 but NzbDrone needs sqlite compiled with SQLITE_ENABLE_COLUMN_METADATA or it won’t even start. And it will need libmediainfo to get info from already download files. And it will need Mono of course.
All the above is met by the above mentioned Mono for ARM package but I don’t know if that’s true for the official 2.11 version (I guess not).

If you run it on QNAP ARM: After installing or enabling it give it a minute or two. It will max you your CPU while starting.


P.S Thanks for the reply :slight_smile:

Those are two separate processes? I assume one is related to the plugin, but I don’t know much about QNAP

I’m not sure myself, might be able o determine it from the symlink to the versioned (so/dll/whatever is used on QNAP).

What type of storage is? /share/MD0_DATA/ ?

On Qnap, they are referred to as “Apps” and I have to toggle them off and on to get Sonar working.

Yes, the storage is as you described. (Still looking for the SQLite version number)

Any further help here?

Its still not clear to me what type of storage /share/MD0_DATA/ is. If its part of a share its possible something is locking the DB.

I’m not really sure what else we can look at, but I think at the moment we should try to back up your database, clean out Sonarr (both the App package and the data), do a fresh install and update to the latest version, then see if the issue occurs with a fresh database (add a couple series, indexer and download client to see if its all working), if its working then try a restore of the database.

Do you know if there is an updated QNAP package? Or should I continue to use the one I linked to earlier? (I believe it does allow me to update from Git on the one I have)

I’m not aware of one, but we don’t publish one ourselves.

Ok, so I finally got around to reinstalling Sonarr on my QNAP (Litterally) and I’ve got the exact same issue. The software seems stable for only a few minutes before I’m getting the database is locked error, and I can’t do anything until the software has been restarted.

If you’re not on Sonarr 2.0.0.3004 (or later), you definitely need to update first.

Trace logs are also required so we can see whats going on.

I am currently on 2.0.0.3004 as far as I can tell. On the Updates page, there is a green “Installed” button next to it.

As for the logs, I have attached them here: http://level42.ca/files/log.txt (Was to big for pastebin)

Thanks. Currently this issue is at least partially solved in develop, but we’re seeing another locking issue that is being investigated, so its not recommended to switch over.

The next release of Sonarr will have a number of improvements to correct this issue and hopefully eliminate it.

Thanks for the update. Is there any ETA on the next release?

No ETA, we’re still hunting a bug before we can release.

Just so I’m clear, what I’m looking for is a full “Release” found here: https://github.com/Sonarr/Sonarr/releases

Right?

No, it will show up in Sonarr under System: Updates

Right, but my Sonarr currently doesn’t work, so I’m trying to keep an eye out for updates offline.

(or it works, but only for a couple moments at a time)

Another thing I noticed in playing with it today, is that it seems to lock up when it starts to scan SouthPark.

I’m curious to simply delete the entire database and start from scratch, to see if I get similar results. Can you let me know where I might find the show database, or at least what it’s called so I can look for it and hopefully remove it.

Ahh right, sorry, there isn’t a public listing of updates. You could switch to the develop version though, I believe we have found the source of the issue, but we’re still doing testing.

If you want to delete the DB and start again its here:
/share/homes/admin/.config/NzbDrone - nzbdrone.db

Ok, I’ve deleted my DB, and I will keep an eye on it. Also, I switch the branch in my config.xml file to develop, but Sonarr doesn’t seem to be updating. How can I force it to fetch a new build?

Disregard, Sonarr needed to be rebooted for changes to take affect.