Kodi Community Forum
Linux "File not found" once after resume - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Linux "File not found" once after resume (/showthread.php?tid=128629)

Pages: 1 2


"File not found" once after resume - User 99988 - 2012-04-12

I've been having a problem since the very first day I installed XBMC Live (Dharma). After I recently updated my Live installation to Eden and the problem still persisting, I decided to get help from you guys.

Here's the situation: All my library files are shared across my network using a samba share on my NAS. My HTPC is connected via wire to the switch the NAS is also connected to.

Now everytime I resume standby after a longer period, I get the "file not found, do you want to remove it from the library?"-dialog. If I try to play the file again, right after having clicked "No", it always plays. After that, playing every other file also works without a problem. Even when I enter standby again and resume right after that, it works.

The problem only exists after longer periods of standby.
Another important info: The NAS is NOT in standby and there doesn't seem to be a timeout issue: The dialog appears right away, without waiting the 20 seconds I defined in advancedsettings.xml:
Code:
<samba>
    <clienttimeout>20</clienttimeout>
</samba>

When the NAS is indeed in standby, XBMC waits until it woke up and then plays the selected file like a charm.


Debug Log: http://pastebin.com/XR9iSrgs
Here's what I did: Resumed from standby, enabled debugging, went to "TV shows", tried to play an episode, got the dialog, clicked "No", immediately tried to play the same episode again, it played, stopped the playback, disabled debugging.

As you can see, I added my NAS as a source with a hostname instead of an IP, so I can change it easier in the future.
This is how I entered the hostname in my /etc/hosts file:
Code:
127.0.0.1    localhost
192.168.0.3    HTPC.localdomain    HTPC
192.168.0.2    NAS.localdomain        NAS


I hope you guys can make something from the information I gave. If not, please tell me what ever might be missing!


RE: "File not found" once after resume - Devaron - 2012-04-12

Hi there,

I had the same problem, though i only had this after installing Eden. Never had this on Dharma. Apparently the IP adress can refresh after resume from sleep/suspend, which causes this problem. I managed to solve it, and i will explain how i did this. I must however add that i do NOT know a lot about Linux/Ubuntu. Only thing i know is that this helped me solve the "File not found" issue after resuming (XBMC 11 "Eden" and XBMCBuntu). I don't know if this will help you in your case.

I found this solution somewhere on some forum, but don't remember where. So thanks to the poster Wink

- Open the command line interface and go to "/etc/pm/sleep.d/"

- Create a new file named "10restartnetwork"

- Put the following code in the file and save and close it:

Code:
#!/bin/sh
case "$1" in
    resume|thaw)
        pkill NetworkManager
    ;;
    suspend|hibernate)
        # Do nothing
    ;;
esac

- Next, make the file executable by using the command "chmod +x 10restartnetwork"

- Now, if there is a file in the current directory named "99lirc_resume" you should disable this file to make sure it doesn't interfere with the script you just saved. Do this by typing "chmod -x 99lirc_resume"

- Reboot and try it out.

If you have any problems, you can revert to your old settings by deleting the new file (10restartnetwork) and making the file "99lirc_resume" (if it exists) executable again (chmod +x 99lirc_resume).

Hope this helps!


RE: "File not found" once after resume - User 99988 - 2012-04-12

(2012-04-12, 19:51)Devaron Wrote: Hi there,

I had the same problem, though i only had this after installing Eden. Never had this on Dharma. Apparently the IP adress can refresh after resume from sleep/suspend, which causes this problem. I managed to solve it, and i will explain how i did this. I must however add that i do NOT know a lot about Linux/Ubuntu. Only thing i know is that this helped me solve the "File not found" issue after resuming (XBMC 11 "Eden" and XBMCBuntu). I don't know if this will help you in your case.

I found this solution somewhere on some forum, but don't remember where. So thanks to the poster Wink


Thank you for your answer! Have you also had this problem only ONCE after resuming? Because your solution sounds like it might help in a situation where the client gets the IP from a DHCP server, which is not the case for my HTPC. Also, pinging the NAS using
Code:
ping NAS
directly after resuming works and even after that, playing a file doesn't. Once. And then it works.

But I'll try it anyways, as soon as I get home.


RE: "File not found" once after resume - KidKiwi - 2012-04-12

I also have this problem - still running Dharma 10.0. It does it more often than not. I have found that resuming from standby and leaving it for several minutes before using it helps.

My xbmc box gets it's IP from a DHCP server. I thought perhaps setting a static IP would help - but obviously not. I've also got into the habit of checking the system info using the "i" button on the front menu. This always shows the internet is NOT connected when this happens.

I will try the above solution as well.


RE: "File not found" once after resume - teeedubb - 2012-04-13

Instead of pinging you could try listing the contents of a small file on the nas.

cat /file/on/nas


RE: "File not found" once after resume - User 99988 - 2012-04-14

(2012-04-12, 23:03)KidKiwi Wrote: I also have this problem - still running Dharma 10.0. It does it more often than not. I have found that resuming from standby and leaving it for several minutes before using it helps.

Absolutely. I would say it does it 19 out of 20 times. I also noticed that waiting helps.

(2012-04-12, 23:03)KidKiwi Wrote: My xbmc box gets it's IP from a DHCP server. I thought perhaps setting a static IP would help - but obviously not. I've also got into the habit of checking the system info using the "i" button on the front menu. This always shows the internet is NOT connected when this happens.

I will try the above solution as well.

Interesting, I will take a look at the internet connection status the next time, too. That might be something that helps tracking the issue down.

(2012-04-13, 00:22)teeedubb Wrote: Instead of pinging you could try listing the contents of a small file on the nas.

cat /file/on/nas

Will do. I still couldn't find time for the suggestion in post #2, but this weekend I should be able to try both.


RE: "File not found" once after resume - Devaron - 2012-04-14

(2012-04-12, 22:33)soopersonic Wrote: Have you also had this problem only ONCE after resuming?

Yes i had this too. I agree that my former problem appears to differ from yours. So i'm very curious if the solution works for you and KidKiwi :-)



RE: "File not found" once after resume - User 99988 - 2012-04-17

I've been able to do some testing and this is what came from it:

1) There's no NetworkManager in my installation of Linux (which was is an XBMC Live (Dharma) installation, which I've upgraded to Eden)
2) When looking at the connection info screen (as stated above by KidKiwi), my internet connection states "Connected", even if the popup will appear afterwards.


RE: "File not found" once after resume - NotDave - 2012-04-17

I too have the same problem, just about every time after xbmc resumes from suspend. Both xbmc and server are up and running (responding to pings) but fails on the very first smb request. This happens to both dharma and eden. The above trick with networkmanager did not fix the problem.


RE: "File not found" once after resume - User 99988 - 2012-04-18

I did some further testing and couldn't really find anything.
The only thing I know: My NAS does not get any failed login attempts. So it's not the path substitution (passwords.xml) not working and XBMC trying to login without username/password in path. That would come up in my NAS' logs.
XBMC just doesn't seem to try at all...


RE: "File not found" once after resume - Devaron - 2012-04-19

Strange... Seems like there's some sort of delay or something.

Don't know if this will help but have you tried this:

Open your /etc/samba/smb.conf file and look for the line that begins with "socket options". The total line is probably something like this:

Code:
socket options = TCP_NODELAY

Now change the line to:

Code:
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

And restart the Samba service.

According to the comments in the smb.conf file itself:

Most people will find that this option gives better performance. See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html for details.

It's a long shot but who knows Smile


RE: "File not found" once after resume - User 99988 - 2012-04-25

(2012-04-19, 19:24)Devaron Wrote: Strange... Seems like there's some sort of delay or something.

Don't know if this will help but have you tried this:

Open your /etc/samba/smb.conf file and look for the line that begins with "socket options". The total line is probably something like this:

Code:
socket options = TCP_NODELAY

Now change the line to:

Code:
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

And restart the Samba service.

According to the comments in the smb.conf file itself:

Most people will find that this option gives better performance. See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html for details.

It's a long shot but who knows Smile

Would this be on the client or server? I always thought the smb.conf was for server configuration only?


RE: "File not found" once after resume - Devaron - 2012-04-25

AFAIK it's also for client configuration, but don't quote me on that.

I have done this on my XBMC machine, but if that doesn't work you can always try it on the server. Also it couldn't hurt reading the "speed.html" file i referred to in my previous post for more information. Nod


RE: "File not found" once after resume - User 99988 - 2012-04-25

(2012-04-25, 16:56)Devaron Wrote: AFAIK it's also for client configuration, but don't quote me on that.

I have done this on my XBMC machine, but if that doesn't work you can always try it on the server. Also it couldn't hurt reading the "speed.html" file i referred to in my previous post for more information. Nod

And have you been able to get rid of the problem by setting these options?


RE: "File not found" once after resume - Devaron - 2012-04-25

What i did to get rid of the problem is mainly what's in my first post in this thread (the script). After using that script a few days i had a feeling that the connection between XBMC and my NAS was a bit slow. I have to say it was nothing more than that... a "feeling". But i decided to search some more on the internet.

Then i read somewhere that setting these "socket options" helped people speed up their connection to the NAS, and i decided to enable that too. After that the connection did "feel" a bit more stable and somewhat faster then before, but i have no "hard evidence" for that... Smile