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

Search Error in KOReader #119

Open
cebo29 opened this issue Nov 18, 2024 · 5 comments
Open

Search Error in KOReader #119

cebo29 opened this issue Nov 18, 2024 · 5 comments

Comments

@cebo29
Copy link

cebo29 commented Nov 18, 2024

Since a Short Time I get a 400 Bad Requests, if i search for a book in ODPS feed. If go thru the Categories i will find the book und can Download it.
If i search in Browser there ist no problem.
Screenshot_20241118-182540_1

@mikespub
Copy link
Member

COPS itself does not reply with 400 Bad Request, so something else must have changed either on the server/container/NAS it's running on, or with KOReader.

Can you provide any more details, like any version or configuration changes and/or server logs?

@cebo29
Copy link
Author

cebo29 commented Nov 18, 2024

I use the linuxserver.io Docker Image and start it with a docker comopose file.

services:
cops:
image: lscr.io/linuxserver/cops:latest
container_name: cops
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
interval: 60s
timeout: 10s
start_period: 5s
retries: 4
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- ./config:/config
- /mnt/Multimedia/calibre:/books
ports:
- 81:80
restart: unless-stopped

In the Docker Log i didn't find anything.

@mikespub
Copy link
Member

Hi @cebo29 thanks for that.

In your local ./config directory you should have access to both nginx/access.log and nginx/error.log, and php/error.log.

It may be that the error.log files don't contain anything - I believe you need to change the error_log to "info" for nginx to report why it sent back 400 Bad Request.

But could you find out in the nginx/access.log which URL KOReader was trying to reach when it got the 400 error, and how it compares to previous/next URLs?

172.19.0.1 - - [19/Nov/2024:17:19:50 +0000] "GET /index.php/feed HTTP/1.1" 200 4327 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
172.19.0.1 - - [19/Nov/2024:17:20:04 +0000] "GET /index.php/feed/search HTTP/1.1" 200 503 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
172.19.0.1 - - [19/Nov/2024:17:20:14 +0000] "GET /index.php/feed?query=ali HTTP/1.1" 200 1258 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"

The last line will probably have "GET /... HTTP/1.1" 400 ... instead of 200 then.

@cebo29
Copy link
Author

cebo29 commented Nov 20, 2024

Hi @mikespub,

thank you for answer.

My error log from 18.11.:

2024/11/18 17:57:30 [error] 280#280: *17969 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.1.1.72, server: _, request: "HEAD /feed.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "10.1.1.220:81"
2024/11/18 17:57:30 [error] 280#280: *17971 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.1.1.72, server: _, request: "GET /feed.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "10.1.1.220:81"

I think this is another error!

I have a access log with 400 entries:
https://pastebin.com/sqpSFbZB

Where can i change error log to info?

I recognized that a search without a space give me a result without errors. If i have a space in the search like "maddrax 56" i get the Bad Request Error.

@mikespub
Copy link
Member

Thanks, that really helps pin down the issue - it seems I still missed a rawurlencode() to deal with spaces in the query param when switching to route URLs. I'll try to fix that for the next release...

Note: that first /feed.php error is from before you switched the URL to /index.php/feed and it (correctly) states that there is no more feed.php script. The old endpoints were indeed removed in release 3.3.1

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