v17 Win10 App crashes if NAS not available
#1
Hi,

I'm very new to Kodi. I like to use Kodi on my PC, Tablets and FireTV sticks.

For my first start I used Windows 10 Kodi App (17.3 Krypton) and the add-on 'Advanced WOL'.
I started Kodi App and Advanced WOL did his job - the NAS started and I had access to my video and music files stored on my NAS.

But I don't like to support many local libraries I saw the way to centralize the library using a MySQL on my NAS.
Therefore I create a MySQL database running on my NAS.
The changes for KODI in advancedsettings.xml are done and if NAS is running everything is fine.
Centralized library works as expected.

But my NAS does not run 24h. It shutdowns if no client is connected anymore and shutdown in the night at 2 o'clock.
If I start the Kodi App (NAS is shutdown) the start screen (Kodi logo and version) remains and Windows tell me that the application is not responding.
The add-on 'Advanced WOL' cannot do his job because Kodi App hangs, maybe in initializing phase.
If I start my NAS by hand the Kodi App starts and 'Advanced WOL' report 'NAS is awake!.

I don't know if the other Apps (iOS, Android) shows the same behaviour, but this issue is not really nice.

Is there a way to get Kodi App started even though my NAS is shutdown? Or is itt a bug in the Windows 10 Store App?

Thx
Reply
#2
A workaround is to create 2 different Kodi profiles.
One profile for full MySQL access, and one for local access only.
When you know the NAS is offline, choose the local profile.

Kodi does have a timeout on non-active external connections, but a NAS usually tends to take much more time to "wake-up" than Kodi is prepared to wait.
Reply
#3
Personally I'd solve it the other way around. Use a command line tool to wake your NAS before you start KODI.

Examples:

http://www.matcode.com/wol.htm
https://www.depicus.com/wake-on-lan/wake-on-lan-cmd

Now you can either just put a link on the desktop to manually click each time.

Or to be a little more automatic, write a small batch file that runs wolcmd before starting KODI.
Reply
#4
(2017-06-29, 20:47)Klojum Wrote: A workaround is to create 2 different Kodi profiles.
One profile for full MySQL access, and one for local access only.
When you know the NAS is offline, choose the local profile.

Kodi does have a timeout on non-active external connections, but a NAS usually tends to take much more time to "wake-up" than Kodi is prepared to wait.
Hi Klojun,

thanks for your reply. 2 Profiles sounds interessting. I will try.
But your statement is not correct in this case. Kodi do not start any add-on if the external library is not available. Therefore the WOL add-on does not send out a magic packet, therefore no start of NAS happens.

(2017-06-29, 21:12)BatterPudding Wrote: Personally I'd solve it the other way around. Use a command line tool to wake your NAS before you start KODI.

Examples:

http://www.matcode.com/wol.htm
https://www.depicus.com/wake-on-lan/wake-on-lan-cmd

Now you can either just put a link on the desktop to manually click each time.

Or to be a little more automatic, write a small batch file that runs wolcmd before starting KODI.
Hi BatterPudding,

thanks for your reply. Of course, a cmdline WOL tool was my very first solution before I found the WOL add-on. But with the WOL add-on it would be easy and would do exactly what I expects.

By-the-way: I started Kodi 10 minutes ago, nothing happens. The log/splash screen remains. After I start my NAS with the cmdline WOL, Kodi jump to the start screen, said "Hey your NAS is awake" ;-)

I suspect that is a bug. Is there a bugzilla or something like this to report this issue as bug?

Thx
Reply
#5
Turn debugging on, restart kodi and look at the log to see what it's actually trying to do.

Having said that, I'd just be going down the path of writing a launch kodi script, which wakes up the NAS, waits for it to become available then starts kodi.
Reply
#6
Turning NASes off always seems wrong to me, a server is a server is 24/7.

However I know some people prefer to save power, and (perhaps) wear and tear on their hardware.

If I were in this situation, I would run the MySQL server on another low power device like a raspberry pi, or more ideally an odroid xu4, and leave that on 24/7. Then it is always on and kodi will start properly. The NAS might take a bit longer to start up, but at least your library will be active at kodi startup.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#7
(2017-06-30, 04:30)Gobberwart Wrote: Turn debugging on, restart kodi and look at the log to see what it's actually trying to do.

Having said that, I'd just be going down the path of writing a launch kodi script, which wakes up the NAS, waits for it to become available then starts kodi.

Hi Gobberwart,

I see all the things I expected in logfile:
Code:
09:52:59.181 T:1120  NOTICE: Running database version Addons27
09:52:59.181 T:1120   DEBUG: CDatabaseManager::Initialize, updating databases...
09:52:59.183 T:1120  NOTICE: Running database version ViewModes6
09:52:59.186 T:1120  NOTICE: Running database version Textures13
09:52:59.189 T:1120  NOTICE: Running database version MyMusic60
09:52:59.743 T:7556   DEBUG: CRemoteControl::Connect - connecting to: 127.0.0.1:24000 ...
09:53:00.745 T:7556   DEBUG: CRemoteControl::Connect - failed to connect
09:53:00.745 T:7556    INFO: CRemoteControl::Process - failed to connect to irss, will keep retrying every 5 seconds
09:53:20.193 T:1120   ERROR: Unable to open database: MyVideos107 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:53:41.196 T:1120   ERROR: Unable to open database: MyVideos106 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:54:02.198 T:1120   ERROR: Unable to open database: MyVideos105 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:54:23.204 T:1120   ERROR: Unable to open database: MyVideos104 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:54:44.207 T:1120   ERROR: Unable to open database: MyVideos103 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:55:05.209 T:1120   ERROR: Unable to open database: MyVideos102 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:55:26.213 T:1120   ERROR: Unable to open database: MyVideos101 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:55:47.214 T:1120   ERROR: Unable to open database: MyVideos100 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:56:08.217 T:1120   ERROR: Unable to open database: MyVideos99 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:56:29.226 T:1120   ERROR: Unable to open database: MyVideos98 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:56:50.227 T:1120   ERROR: Unable to open database: MyVideos97 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:57:11.229 T:1120   ERROR: Unable to open database: MyVideos96 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:57:32.233 T:1120   ERROR: Unable to open database: MyVideos95 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:57:53.237 T:1120   ERROR: Unable to open database: MyVideos94 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:58:14.240 T:1120   ERROR: Unable to open database: MyVideos93 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:58:35.247 T:1120   ERROR: Unable to open database: MyVideos92 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:58:56.248 T:1120   ERROR: Unable to open database: MyVideos91 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:59:17.249 T:1120   ERROR: Unable to open database: MyVideos90 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:59:38.250 T:1120   ERROR: Unable to open database: MyVideos89 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
09:59:59.253 T:1120   ERROR: Unable to open database: MyVideos88 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:00:20.264 T:1120   ERROR: Unable to open database: MyVideos87 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:00:41.266 T:1120   ERROR: Unable to open database: MyVideos86 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:01:02.268 T:1120   ERROR: Unable to open database: MyVideos85 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:01:23.270 T:1120   ERROR: Unable to open database: MyVideos84 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:01:44.271 T:1120   ERROR: Unable to open database: MyVideos83 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:02:05.274 T:1120   ERROR: Unable to open database: MyVideos82 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:02:26.275 T:1120   ERROR: Unable to open database: MyVideos81 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:02:47.277 T:1120   ERROR: Unable to open database: MyVideos80 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:03:08.280 T:1120   ERROR: Unable to open database: MyVideos79 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:03:29.282 T:1120   ERROR: Unable to open database: MyVideos78 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:03:50.285 T:1120   ERROR: Unable to open database: MyVideos77 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:04:11.288 T:1120   ERROR: Unable to open database: MyVideos76 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:04:32.294 T:1120   ERROR: Unable to open database: MyVideos75 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:04:53.306 T:1120   ERROR: Unable to open database: MyVideos107 [2003](Can't connect to MySQL server on '192.168.0.101' (10060))
10:04:53.306 T:1120   ERROR: Unable to create new database
10:04:53.308 T:1120  NOTICE: Running database version TV29
10:04:53.310 T:1120  NOTICE: Running database version Epg11
10:04:53.312 T:1120   DEBUG: CDatabaseManager::Initialize, updating databases... DONE
10:04:53.313 T:12204   DEBUG: DPMS: supported power-saving modes: OFF STANDBY
10:04:53.363 T:21728   DEBUG: CAnnouncementManager - Announcement: OnClear from xbmc
10:04:53.363 T:21728   DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnClear
10:04:53.375 T:12204    INFO: Unloading old skin ...
10:04:53.376 T:12204    INFO:   load skin from: C:\Program Files\WindowsApps\XBMCFoundation.Kodi_17.3.0.0_x86__4n2hpmxwrvr6p\addons\skin.estuary (version: 1.9.16)
10:04:53.376 T:12204    INFO:   load fonts for skin...
10:04:53.377 T:12204    INFO: Loading fonts from C:\Program Files\WindowsApps\XBMCFoundation.Kodi_17.3.0.0_x86__4n2hpmxwrvr6p\addons\skin.estuary\xml\Font.xml
The app tried more than 10 minutes to connect to database and after all this retries the app starts without database.

Thx,
Reply
#8
It's spending ten minutes trying to connect to a mysql server that isn't running because your nas is offline. I assume it's then defaulting to regular local db files instead.

I don't see this as a bug. Kodi needs to be able to access its databases to be able to function.

The whole point of using mysql with kodi is to have an easily accessible, shared database location. By turning the server off, it's no longer easily accessible.

The wol addon is never going to help with this. Kodi needs its databases to even know that the wol addon exists.

I'm not clear on your reasons for using mysql in this way. If you're going to persist with it, you're going to need to get creative and find a way to start the server before kodi.

I'd be using a script that does the following..

If (can't connect to mysql port on nas) {
Send wol
While (still can't connect) {
Sleep 5 seconds
}
}
Launch kodi
Reply
#9
Or just leave your nas on. That's kinda what they're for.
Reply
#10
Quote:Or to be a little more automatic, write a small batch file that runs wolcmd before starting KODI.
^
This
Reply
#11
Hi all,

thanks for your replies and comments.

(2017-07-20, 00:38)Gobberwart Wrote: Kodi needs its databases to even know that the wol addon exists.

OK, then Kodi works as designed.

I get Kodi working with two profiles. But for me it is a little bit to uncomfortable to start with profile one, wait until local db is loaded, wol addon is started and my nas is up and running, then change to profile two.

I think I try it with a batch or script.

(2017-07-20, 04:51)Gobberwart Wrote: Or just leave your nas on. That's kinda what they're for.
Yes, but why should a nas (or every technical device) powered on, if you know you will not use it (e.g. you are absent).
Reply
#12
(2017-07-22, 19:06)opape Wrote:
(2017-07-20, 04:51)Gobberwart Wrote: Or just leave your nas on. That's kinda what they're for.
Yes, but why should a nas (or every technical device) powered on, if you know you will not use it (e.g. you are absent).

Why have a NAS then, just attach storage to your system that powers down, so all your data does too. Your counter-point makes no sense.
Reply
#13
(2017-07-22, 19:06)opape Wrote:
(2017-07-20, 04:51)Gobberwart Wrote: Or just leave your nas on. That's kinda what they're for.
Yes, but why should a nas (or every technical device) powered on, if you know you will not use it (e.g. you are absent).

Because that's what a nas is for. The whole point of a nas is to have external storage available to your entire network whenever it's needed. If you're just going to go around turning it off and on whenever you want to use it, you'd be better off with a USB drive.

I'm sure you have your reasons, but your use case is not really part of nas design.
Reply

Logout Mark Read Team Forum Stats Members Help
Win10 App crashes if NAS not available0