xbmc / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS, tvOS and Windows.
https://kodi.tv/
Other
18.56k stars 6.3k forks source link

Android Kodi Couldn't connect to network server Macos nfsd #23012

Open GaleHuang opened 1 year ago

GaleHuang commented 1 year ago

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

start nfsd on MacOS, and use Kodi Android to visit the nfs server, kodi is able to recognize the source and list the root directory, but when entering the root directory in Kodi Android, it throw error "Couldn't connect to network server".

In addition, Kodi cannot connect to the webdav server in MacOS either, but the phone browser can do it.

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Kodi can enter the root directory successfully.

Actual Behavior

when entering the root directory in Kodi Android, it throw error "Couldn't connect to network server".

Possible Fix

To Reproduce

Steps to reproduce the behavior:

  1. in MacOs catalina
    vim /etc/exports
    # add line
    /Users/someone/Videos -alldirs -mapall=someone:staff 192.168.0.0/16
    # save and quit
    sudo nfsd start
    sudo nfsd update
    showemout -e
    Exports list on localhost:
    /Users/someone/test             Everyone
  2. on Android kobi, connect to the nfs server

Debuglog

The debuglog can be found here:

2023-03-19 17:41:48.440 T:28394   error <general>: NFS: Failed to mount nfs share: /Users/someone/test (mount_cb: )
2023-03-19 17:41:48.441 T:28394   error <general>: GetDirectory - Error getting nfs://192.168.2.10/Users/someone/test/
2023-03-19 17:41:49.571 T:28403   error <general>: NFS: Failed to mount nfs share: /Users/someone/test (mount_cb: )
2023-03-19 17:41:49.571 T:28403   error <general>: GetDirectory - Error getting nfs://192.168.2.10/Users/someone/test/

Screenshots

Here are some links or screenshots to help explain the problem:

image

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required. Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

AbdelAzizMohamedMousa commented 1 year ago

Based on the information provided, it is difficult to determine the root cause of the issue. However, here are some steps you can try to troubleshoot the problem:

Check if the network connection is stable and the IP address of the NFS server is correct.

Check the NFS server configuration and make sure that the exported directory is configured correctly.

Check the Kodi Android settings and make sure that the correct NFS version is selected.

Try to access the NFS server from another device, such as a computer or another mobile device, to see if the issue is specific to Kodi Android.

Try to access the NFS server using a different protocol, such as SMB or FTP, to see if the issue is specific to NFS.

Check the Kodi Android log files for any error messages that might provide more information about the issue.

If none of the above steps resolve the issue, try posting a detailed bug report on the Kodi Android GitHub page or forum, including any relevant log files or error messages.

AbdelAzizMohamedMousa commented 1 year ago

It seems that the issue is related to the NFS server configuration on MacOS. Here are a few things you could try:

Check that the NFS server is running properly on the MacOS system. You can do this by running the following command in the terminal: sudo nfsd checkexports

This should output a list of exported directories. If you don't see your exported directory listed, then there might be an issue with the export configuration.

Check the NFS export configuration. Make sure that you have specified the correct IP address range in the /etc/exports file. Also, make sure that the exported directory has the correct permissions and ownership.

Check the firewall settings on the MacOS system. Make sure that the NFS port (port 2049) is open in the firewall.

Check the Kodi settings on Android. Make sure that the NFS protocol is selected in the file manager settings. Also, make sure that the correct IP address is entered for the NFS server.

If none of these steps work, you could try using a different protocol (such as SMB or FTP) to access the files on the MacOS system.

pduveau commented 1 year ago

I think the problem you are facing is that Android assigns a UID to Kodi during installation that is not "predictable" for end users. I encountered the same problem between Android and Debian, I was able to know this UID with a debug connection via adb. As it was not possible to find a solution that works in all cases, I decided to propose an enhancement (#23302) that is still under review. With this evolution, it is possible to set the UID and GID used by Kodi for NFS connections as well as the permissions on files created by Kodi. Previously, I used the options all_squash, anonuid and anongid on exports. However, I guess the -mapall=user:group option does the same thing

github-actions[bot] commented 3 months ago

This issue is now marked stale because it has been open over a year without activity. Remove the stale label or add a comment to reset the stale state.