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

API regression for user/-/state/com.google/starred #5363

Closed
Alkarex opened this issue Apr 30, 2023 · 18 comments · Fixed by #5366
Closed

API regression for user/-/state/com.google/starred #5363

Alkarex opened this issue Apr 30, 2023 · 18 comments · Fixed by #5366
Assignees
Labels
API 🤝 API for other clients Bug (unconfirmed) issues thar could not reproduced yeat
Milestone

Comments

@Alkarex
Copy link
Member

Alkarex commented Apr 30, 2023

A git bisect suggests that this commit broke the GReader API (the log shows GReaderAPI::internalServerError for the route user/-/state/com.google/starred). Before this, the API worked fine, and the UI still does.

Posted by @JFronny in c72914b#commitcomment-111220080

@Alkarex Alkarex added API 🤝 API for other clients Bug (unconfirmed) issues thar could not reproduced yeat labels Apr 30, 2023
@Alkarex Alkarex added this to the 1.22.0 milestone Apr 30, 2023
@Alkarex
Copy link
Member Author

Alkarex commented Apr 30, 2023

Hello @JFronny and thanks for the bug report.
To help isolating the bug, could please tell:

  • what action more precisely is triggering the bug (is it listing starred articles?)
  • what database you are using (e.g. SQLite, PostgreSQL, MariaDB, MySQL)
  • what PHP version
  • what client you are using

@JFronny
Copy link

JFronny commented Apr 30, 2023

  • it is triggered by "syncing" (reloading by "pulling down" in the article list) from Readrops (installed via F-Droid), which probably includes downloading the list of starred articles
  • mysql Ver 8.0.32-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu)) in an otherwise clean Proxmox LXC container with Ubuntu 22.04
  • PHP 8.1.2-1ubuntu2.11 via apache2 (as is recommended in the docs)
  • Readrops 1.3.1 (installed from F-Droid)

@Alkarex
Copy link
Member Author

Alkarex commented Apr 30, 2023

Do you have any stack trace in your logs or similar?

Edit: in your FreshRSS and/or Web server logs.
FreshRSS logs are found in ./data/users/*/log*.txt

@franztv82
Copy link

franztv82 commented Apr 30, 2023

Hello,
i'm having the same issue. My apache error log throws this when the error occurs:

[Sun Apr 30 13:09:59.444128 2023] [proxy_fcgi:error] [pid 869:tid 139693794788928] [client 192.168.100.109:51500] AH0107
1: Got error 'PHP message: PHP Fatal error: Uncaught ValueError: PDOStatement::bindValue(): Argument #1 ($param) must b
e greater than or equal to 1 in /usr/share/FreshRSS/lib/Minz/ModelPdo.php:200\nStack trace:\n#0 /usr/share/FreshRSS/lib/
Minz/ModelPdo.php(200): PDOStatement->bindValue()\n#1 /usr/share/FreshRSS/lib/Minz/ModelPdo.php(240): Minz_ModelPdo->fet
chAny()\n#2 /usr/share/FreshRSS/app/Models/EntryDAO.php(1209): Minz_ModelPdo->fetchColumn()\n#3 /usr/share/FreshRSS/p/ap
i/greader.php(748): FreshRSS_EntryDAO->listIdsWhere()\n#4 /usr/share/FreshRSS/p/api/greader.php(1106): GReaderAPI::strea
mContentsItemsIds()\n#5 /usr/share/FreshRSS/p/api/greader.php(1209): GReaderAPI::parse()\n#6 {main}\n thrown in /usr/sh
are/FreshRSS/lib/Minz/ModelPdo.php on line 200'

Perhaps it helps...

@Alkarex Alkarex self-assigned this Apr 30, 2023
Alkarex referenced this issue Apr 30, 2023
* PHPStan Level 7 for more DAO PDO
With new function to address common type and check problems

* A bit more

* PHPStan Level 7 for FreshRSS_Entry
Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Apr 30, 2023
@Alkarex
Copy link
Member Author

Alkarex commented Apr 30, 2023

Would you be able to give a try to this patch? #5366

@franztv82
Copy link

I'm not (yet) familiar with github. What's best practice to apply this patch?

@Alkarex
Copy link
Member Author

Alkarex commented Apr 30, 2023

It depends on how you installed FreshRSS.
Assuming you installed by git, you can run the following command from your FreshRSS directory:

git pull https://github.com/Alkarex/FreshRSS.git fix-api-starred

@franztv82
Copy link

Thanks, applying the patch worked fine. But the internal server error is still there. Here's my log_api.txt:

[Mon, 01 May 2023 07:56:42 +0200] [warning] --- GReaderAPI::internalServerError

In apache error log is no entry.

@Alkarex
Copy link
Member Author

Alkarex commented May 1, 2023

@franztv82 Could you please check your ./data/users/_/log_api.txt

@franztv82
Copy link

[Mon, 01 May 2023 08:20:58 +0200] [debug] --- GReaderAPI::internalServerError Array
(
    [date] => 2023-05-01T08:20:58+02:00
    [headers] => Array
        (
            [Host] => rss.franz-tv.de
            [Accept-Language] => de-DE,de;q=0.9
            [User-Agent] => NetNewsWire (RSS Reader; https://netnewswire.com/)
            [Accept-Encoding] => gzip, deflate, br
            [Accept] => */*
            [Authorization] => GoogleLogin auth=my_username/█
        )

    [_SERVER] => 
    [_GET] => Array
        (
            [n] => 1000
            [output] => json
            [s] => user/-/state/com.google/starred
        )

    [_POST] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [INPUT] => 
)

@Alkarex
Copy link
Member Author

Alkarex commented May 1, 2023

I have made a little change to the patch. Could you please try again?

@franztv82
Copy link

Still an error, but different log:

[Mon, 01 May 2023 09:10:51 +0200] [debug] --- GReaderAPI::internalServerError Array
(
    [date] => 2023-05-01T09:10:51+02:00
    [headers] => Array
        (
            [Host] => rss.franz-tv.de
            [Accept-Language] => de-DE,de;q=0.9
            [User-Agent] => NetNewsWire (RSS Reader; https://netnewswire.com/)
            [Accept-Encoding] => gzip, deflate, br
            [Accept] => */*
            [Authorization] => GoogleLogin auth=my_username/█
        )

    [_SERVER] => 
    [_GET] => Array
        (
            [n] => 1000
            [output] => json
            [s] => user/-/state/com.google/reading-list
            [xt] => user/-/state/com.google/read
        )

    [_POST] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [INPUT] => 
)

@Alkarex
Copy link
Member Author

Alkarex commented May 1, 2023

Could you please keep the path informations in the _SERVER section, such as $_SERVER['REQUEST_URI'], so I can see which call is failing?

@Alkarex
Copy link
Member Author

Alkarex commented May 1, 2023

Ah, I had forgotten to change a little thing in my last version of the patch. Might be fixed now, if you could please try again

@franztv82
Copy link

Thank you very much, now everything works fine!

@franztv82
Copy link

Could you please keep the path informations in the _SERVER section, such as $_SERVER['REQUEST_URI'], so I can see which call is failing?

Only for my personel interest: how can i do that? I copied the log without any changes...

@Alkarex
Copy link
Member Author

Alkarex commented May 1, 2023

Thanks for the tests and also for using the edge version.

Only for my personel interest: how can i do that? I copied the log without any changes...

Hum, strange. I would have to investigate why this debug information is empty. What PHP version?

Alkarex added a commit that referenced this issue May 1, 2023
* Fix API starred
Fix #5363
c72914b#commitcomment-111220080

* Minor type fix

* Additional check

* Minor syntax change

* Forgotten type change
@franztv82
Copy link

PHP 8.0.25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API 🤝 API for other clients Bug (unconfirmed) issues thar could not reproduced yeat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants