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

Access to the file was denied #13

Open
j0hnckuy opened this issue Aug 16, 2024 · 5 comments
Open

Access to the file was denied #13

j0hnckuy opened this issue Aug 16, 2024 · 5 comments

Comments

@j0hnckuy
Copy link

j0hnckuy commented Aug 16, 2024

I am getting this issue

Access to the file was denied

The file at /root/.local/share/nicotine/plugins/upload_stats/build/index.html is not readable.

It may have been removed, moved, or file permissions may be preventing access.

I am using Nicotine+ 3.3.4 with Python 3.12.3 anf Firefox on Ubuntu 22.

@Nachtalb
Copy link
Owner

Check if the file is there. If so dose it work in other browsers? if not run /up-rebuild to rebuild the page then /up-open to open the page again.

@j0hnckuy
Copy link
Author

j0hnckuy commented Aug 17, 2024

Check if the file is there.

I see index.html and stats.json files in the location that is set in the plugin

If so dose it work in other browsers?

stats.json works in the chrome and index.html doesn't.

if not run /up-rebuild to rebuild the page then /up-open to open the page again.

/up-rebuild gave me this

08/17/2024 05:07:03 AM Upload Statistics - INFO - Command: rebuild, Args: [], Room: None, User: X_X_X_X - Parsed
08/17/2024 05:07:03 AM Upload Statistics - INFO - Rebuilding statistics page
08/17/2024 05:07:03 AM Upload Statistics - DEBUG - Building statistics page
08/17/2024 05:07:03 AM Upload Statistics - DEBUG - Calculating summary
08/17/2024 05:07:03 AM Plugin upload_stats failed with error <class 'FileNotFoundError'>: [Errno 2] No such file or directory: '/root/.local/share/nicotine/plugins/upload_stats/build/playlist.m3u'.
Trace:   File "/usr/local/lib/python3.12/dist-packages/pynicotine/pluginsystem.py", line 899, in _trigger_command
    is_successful = callback(args, user=user)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/nicotine/plugins/upload_stats/upload_stats/npc/npc/command.py", line 445, in wrapper
    return run_func((self, *final_args))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/nicotine/plugins/upload_stats/upload_stats/npc/npc/command.py", line 404, in run_func
    return func(*args)
           ^^^^^^^^^^^
  File "/root/.local/share/nicotine/plugins/upload_stats/upload_stats/plugin.py", line 397, in rebuild_stats_output_cmd
    self.rebuild_page(user_threshold, file_threshold)
  File "/root/.local/share/nicotine/plugins/upload_stats/upload_stats/plugin.py", line 436, in rebuild_page
    self.config.stats_html_file.write_text(self.build_html(), encoding="utf-8")
                                           ^^^^^^^^^^^^^^^^^
  File "/root/.local/share/nicotine/plugins/upload_stats/upload_stats/plugin.py", line 475, in build_html
    "playlist_file": self.file_link(self.config.playlist_file, as_base64=True),
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/nicotine/plugins/upload_stats/upload_stats/plugin.py", line 709, in file_link
    b64 = urlsafe_b64encode(file.read_bytes()).decode("utf-8")
                            ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/pathlib.py", line 1021, in read_bytes
    with self.open(mode='rb') as f:
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/pathlib.py", line 1015, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@j0hnckuy
Copy link
Author

i found it to be working after, in my case, i created the playlist.m3u file which was somehow not generated by the plugin automatically.

so i did

touch '/root/.local/share/nicotine/plugins/upload_stats/build/playlist.m3u'

after this when i open the index.html on chrome it works. but still not on firefox

@Nachtalb
Copy link
Owner

Are you using the latest version of the plugin: https://github.com/Nachtalb/more-upload-stats/releases/tag/v3.1.5

There were some fixes for Firefox a few versions ago maybe it's that.

@j0hnckuy
Copy link
Author

j0hnckuy commented Aug 17, 2024

Yes. Using 3.1.5.

Actually I read the resolved issue related to the firefox.

The firefox version 129.0.1 (64-bit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants