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

Pages don't work - Same results each time. #104

Closed
dehlirious opened this issue Dec 30, 2023 · 18 comments
Closed

Pages don't work - Same results each time. #104

dehlirious opened this issue Dec 30, 2023 · 18 comments

Comments

@dehlirious
Copy link

dehlirious commented Dec 30, 2023

My setup: PHP8.3-fpm + nginx

Instance here, no matter what page is pressed, same results exist. What gives? I'm not too certain what the cause is.

I updated to the latest instance and this was an issue, previously the page buttons worked fine as you can test here , the previous instance works fine.

Other issues that I'd like to bring up to get resolved:
Video tab does not provide any thumbnails! with this err

PHP Warning:  
foreach() argument must be of type array|object, null given in LibreY/engines/invidious/video.php on line 14; 
PHP message: PHP Warning:  Undefined array key "host" in LibreY/engines/librex/fallback.php on line 56; 
...redacted....
PHP message: search3.ahwx.org" ,...
request: "GET /x/LibreY/search.php?p=10&q=test&t=2 HTTP/1.1" ...
PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in LibreY/engines/invidious/video.php:45
Stack trace:
#0 /x/LibreY/misc/search_engine.php(177): VideoSearch::print_results()
#1 /LibreY/search.php(75): fetch_search_results()
#2 {main}
  thrown in /x/LibreY/engines/invidious/video.php on line 45" , request: "GET /x/LibreY/search.php?p=10&q=test&t=2 HTTP/1.1"
PHP Warning:  Undefined variable $page in /var/tera/html/x/LibreY/engines/qwant/image.php on line 4" request: "GET /x/LibreY/search.php?q=test&p=0&t=1 HTTP/1.1", 
2023/12/30 00:23:33 [error] 10#10: *7410 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /var/tera/html/x/LibreY/engines/invidious/video.php:45
Stack trace:
#0 /x/LibreY/misc/search_engine.php(177): VideoSearch::print_results()
#1 /x/LibreY/search.php(75): fetch_search_results()
#2 {main}
  thrown in /x/LibreY/engines/invidious/video.php on line 45" request: "GET /x/LibreY/search.php?q=test&p=0&t=2 HTTP/1.1"

I'm able to sort through and fix some myself but if I don't have to why bother, right?

Anyway can you guys update me with where you're at in the project, anything you'd need, things you want? If I can contribute in a usable way towards development whether it be optimization, bug fixing, new feature implementation, I'd like to but I need to know what is desired so I'm not just working towards things only my single instance will make use of.

@Ahwxorg
Copy link
Owner

Ahwxorg commented Dec 30, 2023

What operating system do you run?

Does hosting LibreY at the root domain give any issues? (e.g: https://search.ahwx.org)

@dehlirious
Copy link
Author

What operating system do you run?

Does hosting LibreY at the root domain give any issues? (e.g: https://search.ahwx.org)

Debian 12, and I'm not sure , I can change my nginx conf to redirect a subdomain to /x/ and test it if you'd like, but personally I would have, or want to have the code able to function regardless of if it's at the base directory or not.

For the "Pages 1, 2, 3, 4" not working, odd that it worked in the previous instance but not the latest instance. Not sure whats goin on there, or what was changed.

@dehlirious
Copy link
Author

dehlirious commented Dec 30, 2023

Root Domain version here (same as /x/LibreY)
Results: Pages still do not function , regardless of p=10 p=320 etc etc, still only showing page 1 results with No PHP errors or warnings.

Images tab:

PHP message: PHP Warning:  Undefined variable $page in /engines/qwant/image.php on line 4" while reading response header from upstream, request: "GET /search.php?q=test&p=0&t=1 HTTP/1.1", host: "search.zrr.us"

Video tab does not provide any thumbnails

PHP message: PHP Warning:  foreach() argument must be of type array|object, null given in /engines/invidious/video.php on line 14; PHP message: PHP Warning:  Undefined array key "host" in /engines/librex/fallback.php on line 56; 
PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /engines/invidious/video.php:45
Stack trace:
#0 /misc/search_engine.php(177): VideoSearch::print_results()
#1 /search.php(75): fetch_search_results()
#2 {main}
  thrown in /engines/invidious/video.php on line 45" while reading upstream, request: "GET /search.php?q=test&p=0&t=2 HTTP/1.1", host: "search.zrr.us"

Torrents tab: (redacted, not the full extent of errors but most repeated, here were the seperate issues I glanced over and saw)

Undefined property: stdClass::$bittorrent_trackers in /engines/bittorrent/thepiratebay.php on line 24; 
PHP message: PHP Warning:  Undefined property: stdClass::$bittorrent_trackers in /engines/bittorrent/thepiratebay.php on line 24; 
stdClass::$bittorrent_trackers in /var/tera/html/x/LibreY/engines/bittorrent/rutor.php on line 19; 
/engines/bittorrent/yts.php on line 28; PHP message: PHP Warning:  Undefined property: stdClass::$bittorrent_trackers

@Ahwxorg
Copy link
Owner

Ahwxorg commented Dec 30, 2023

personally I would have, or want to have the code able to function regardless of if it's at the base directory or not.

I agree, but I'd want to know if that could be an easy fix, at least temporarily.

Debian 12 should be fine, all of my instances are also running on Debian 12.

@Ahwxorg
Copy link
Owner

Ahwxorg commented Dec 30, 2023

I'll look at this tomorrow, it's 02:09 am currently and my brain doesn't want to continue anymore :P

@dehlirious
Copy link
Author

personally I would have, or want to have the code able to function regardless of if it's at the base directory or not.

I agree, but I'd want to know if that could be an easy fix, at least temporarily.

Debian 12 should be fine, all of my instances are also running on Debian 12.

Fair enough. Same errors unfortunately! Actually I caught errors I didn't notice before, with the torrent page lol so more errors.

@dehlirious
Copy link
Author

I'll look at this tomorrow, it's 02:09 am currently and my brain doesn't want to continue anymore :P

No worries! Have a good night.

@codedipper
Copy link

Please post your config.php and related nginx configurations here so we can try to reproduce the issue.

@codedipper
Copy link

PHP 8.3 is not in the Debian 12 bookworm repositories. This is likely because you installed it from the experimental package. This means it is "likely unstable or buggy, and it may even cause data loss". You have been warned.

Yet, all of these issues still occur in the Docker image in #99, which runs on PHP 8.3. From the circumstances, this issue with the same results may be due to results being cached, which may not respect what page you're on.

@codedipper
Copy link

codedipper commented Dec 30, 2023

Without installing php83-pecl-apcu in the Docker image, which therefore disables caching, your problems still persist. I did not test the torrent tab because I don't want the police pointing a red dot through the window. The video tab seems to be relying on public instances for fallback entirely, which are likely still running on PHP 8.2. This is likely a bigger problem than just repeated results.

@davidovski
Copy link

I believe this might be an oversight when implementing caching, looks like the different page numbers arent regarded when caching takes place. Hopefully this should be a simple fix; I have not been testing page 2 at all in any recent changes so its likely that this was broken in a much earlier revision

As for running librex on the root of the domain, i think thats currently necessary, simply due to the way that the different php files are included internally. Theres probably a pretty easy fix for this too, as i dont see any reason why librex shouldnt be able to run at non-root locations.

@davidovski
Copy link

Fixed a bunch of these errors in #105 .

When using php development server, I'm able to put LibreY running in a subdirectory, so that might be an issue with nignx. I'll do a bit of testing now.

I'm not sure what the issue with the video search is, possibly the invidious instance used for results is down. I've been working on #81 so that should eliminate that issue eitherway.

@dehlirious
Copy link
Author

dehlirious commented Jan 2, 2024

I believe this might be an oversight when implementing caching, looks like the different page numbers arent regarded when caching takes place. Hopefully this should be a simple fix; I have not been testing page 2 at all in any recent changes so its likely that this was broken in a much earlier revision

As for running librex on the root of the domain, i think thats currently necessary, simply due to the way that the different php files are included internally. Theres probably a pretty easy fix for this too, as i dont see any reason why librex shouldnt be able to run at non-root locations.

I don't see a difference at all between running it on root domain or sub directory, what makes you believe that's an issue ?

And Sorry I've been busy and haven't gotten back on this subject yet. Just doing a quick response rn. If you want I can send the version where pages work, or search through myself and check all of what was changed.

Or better yet, log the date of the version that works page wise, upload the version where pages work, upload the most recent version, and GitHub will automatically compare all changes, won't be the best / ideal to tell exactly what it was that broke it but it will at least give some ideas as to what's been changed that could've done it.

Please post your config.php and related nginx configurations here so we can try to reproduce the issue.

Config.php between the version of LibRey that works and the version that doesn't , no difference. Default configuration pretty much. Can do if you want though 🤷

@Ahwxorg
Copy link
Owner

Ahwxorg commented Jan 2, 2024

Or better yet, log the date of the version that works page wise, upload the version where pages work, upload the most recent version, and GitHub will automatically compare all changes, won't be the best / ideal to tell exactly what it was that broke it but it will at least give some ideas as to what's been changed that could've done it.

You could make a PR :)

Config.php between the version of LibRey that works and the version that doesn't , no difference. Default configuration pretty much. Can do if you want though 🤷

Please still upload it :)

@dehlirious
Copy link
Author

dehlirious commented Jan 3, 2024

Fixed here / more specifically here
Thanks @davidovski

Proof of Concept located here
Broken version (for now, will be deleted) located here
Prior working version still located here

Config.php between the version of LibRey that works and the version that doesn't , no difference. Default configuration pretty much. Can do if you want though 🤷

Please still upload it :)

Considering that this commit fixed it, I don't see the necessity. And I verified, default config with no alterations.

@davidovski
Copy link

Since #105 has been merged, can this issue be closed? Not sure if theres anything else that's been missed.

@codedipper
Copy link

Can confirm the fix works.

@Ahwxorg
Copy link
Owner

Ahwxorg commented Jan 8, 2024

Since #105 has been merged, can this issue be closed? Not sure if theres anything else that's been missed.

Closing due to inactivity by @dehlirious.

@Ahwxorg Ahwxorg closed this as completed Jan 8, 2024
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

4 participants