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

main page does not load completely sometimes #153

Closed
hypnotoad opened this issue Oct 31, 2023 · 3 comments
Closed

main page does not load completely sometimes #153

hypnotoad opened this issue Oct 31, 2023 · 3 comments

Comments

@hypnotoad
Copy link

Sometimes, the main page does not load properly for me. In the desktop layout, the lower part of the page is missing and in the phone layout, the bottow bar is missing (see below):
grafik

The problems happens in Firefox, Chromium and Android's WebView.

I can reproduce the problem in 4b4213f by reloading the page (f5) a couple of times. The js console reports "panel is undefined". I cannot say whether that is the result of the problem or its origin but it does not happen if the page loads correctly.

I can provide a server debug log or the debug information, if needed.

@hypnotoad
Copy link
Author

PS: Thanks a lot for your work. I would be happy to provide a fix for this issue if you guide me in the right direction.

@fatg3erman
Copy link
Owner

Hmmm. Well this makes no sense :) I can't reproduce it and looking at the code I can see exactly where it's going wrong, but it's one of those places where it can't possibly go wrong :)
There is a slight possibility it might be a timing thing, and there were a few lines of code that should have been updated when I updated to jQuery 3, so I suppose it might be that. You could try pulling the head from the 'develop' branch and see if that fixes it.

@hypnotoad
Copy link
Author

After I initially thought that it is a problem in JS, I found out now that it is rather something in my server setup. The following stack trace is reported from nginx when the page is not loaded fully:

2023/10/31 23:54:48 [error] 33#33: *96353 FastCGI sent in stderr: "PHP message: PHP Warning:  fopen(prefs/jsoncache/commradio/a2ae1e1ba06dfca0e9f47111a6d9337c): Failed to open stream: Permission denied in /var/www/rompr2/util_classes/url_downloader.class.php on line 128; PHP message: PHP Fatal error:  Uncaught TypeError: curl_setopt(): supplied argument is not a valid File-Handle resource in /var/www/rompr2/util_classes/url_downloader.class.php:129
Stack trace:
#0 /var/www/rompr2/util_classes/url_downloader.class.php(129): curl_setopt()
#1 /var/www/rompr2/browser/apis/cache_handler.class.php(32): url_downloader->get_data_to_file()
#2 /var/www/rompr2/streamplugins/classes/commradioplugin.class.php(102): cache_handler->get_cache_data()
#3 /var/www/rompr2/search/g_search_commradio.class.php(13): commradioplugin->get_country_list()
#4 /var/www/rompr2/includes/search_handler.class.php(64): g_search_commradio->__construct()
#5 /var/www/rompr2/skins/desktop/skin.php(207): search_handler->create_search_panel()
#6 /var/www/rompr2/index.php(323): include('...')
#7 {main}
  thrown in /var/www/rompr2/util_classes/url_downloader.class.php on line 129" while reading upstream, client: 192.168.178.93, server: rompr, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "rompr.lan"

The "permission denied" was the problem. Sometimes it would create cache files in this commradio directory which for some unknown reason did not have write permissions for php.

In my web server setup, nginx accesses the files from git (as you call it /home/YOU/web here). It has www-data write permissions for the prefs directory, but apparently not for commradio.

As I think that this cannot happen if one follows https://fatg3erman.github.io/RompR/Installation.html, I close this issue as I guess it was my fault. But I don't really understand how I ended up with broken permissions.

Thank you!

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