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

Unknown column 'next_update_time' in 'field list' #3048

Closed
3 tasks done
nocin opened this issue Jan 14, 2025 · 12 comments
Closed
3 tasks done

Unknown column 'next_update_time' in 'field list' #3048

nocin opened this issue Jan 14, 2025 · 12 comments
Labels

Comments

@nocin
Copy link

nocin commented Jan 14, 2025

IMPORTANT

Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)

  • I have read the CONTRIBUTING.md and followed the provided tips
  • I accept that the issue will be closed without comment if I do not check here
  • I accept that the issue will be closed without comment if I do not fill out all items in the issue template.

Explain the Problem

What problem did you encounter?

Since update to version 25.2.0, feeds are not pulled anymore and the following error message appears in the Nextcloud log:

 DbalException An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'next_update_time' in 'field list'
Error while running background job OCA\News\Cron\UpdaterJob (id: 33551, arguments: null) 

Image

System Information

  • News app version: 25.2.0
  • Nextcloud version: 29.0.10
  • Cron type: (system cron/python updater/...) Using the Nextcloud Cron Docker Container
  • PHP version: 8.2.27
  • Database and version: mysql 10.5.27
@nocin nocin added the bug label Jan 14, 2025
@SMillerDev
Copy link
Contributor

Do you have database migrations that still need to be performed? Because that's a new column

@nocin
Copy link
Author

nocin commented Jan 14, 2025

That could be, but Nextcloud doesn't tell me anything about a database migration.
Image

Is there an occ command I can run to trigger a DB migration?

@Grotax
Copy link
Member

Grotax commented Jan 14, 2025

No migrations are executed automatically when nextcloud updates the app.

Only if you set nextxloud to debug mode you can execute some migration commands.

I'm not really sure what the concept is for the situation that an update was executed but the migration was not executed successfully, every now and then people have issues like this, missing migrations in their database.

It's not an issue with news though.

@Grotax
Copy link
Member

Grotax commented Jan 14, 2025

You will need SQL access to your Database.

  1. check if the migrations table is at least up to date
SELECT * from oc_migrations where app='news';


+------+--------------------------+
| app  | version                  |
+------+--------------------------+
| news | 140200Date20200824201413 |
| news | 150004Date20201009183830 |
| news | 150005Date20201009192341 |
| news | 150200Date20210118190652 |
| news | 150203Date20210204203051 |
| news | 150302Date20210312231251 |
| news | 150400Date20210318215425 |
| news | 250000Date20240817095614 |
| news | 250200Date20241219085150 |
+------+--------------------------+

Version 250200Date20241219085150 is important here.

Then you can try to apply the change manually:

ALTER TABLE oc_news_feeds
ADD COLUMN IF NOT EXISTS next_update_time BIGINT(20) NULL;
COMMIT;

But I have to say that it is experimental, it's not part of the concept for apps to run queries manually.
Maybe also check your logs if something went wrong when you updated the News app, that could help to identify the issue.

@Grotax Grotax added support and removed bug labels Jan 14, 2025
@nocin
Copy link
Author

nocin commented Jan 15, 2025

Thank you for your explanation and the workaround! It seems that it worked! There is no error in the logs, and some feeds were updated after cron ran.
I'm running MariaDB in a Docker Container and was able to add the column using the following commands:

# Access mariadb container
docker exec -it nextcloud-db bash 
# Access MariaDB inside the container
mysql -u root -p
# Display database 
SHOW DATABASES;
# select the nextcloud database
use nextcloud;
# check if the migrations table is at least up to date
SELECT * from oc_migrations where app='news';
# run the command to add the missing column
ALTER TABLE oc_news_feeds
    -> ADD COLUMN IF NOT EXISTS next_update_time BIGINT(20) NULL;

Query OK, 0 rows affected (0.038 sec)
Records: 0  Duplicates: 0  Warnings: 0

# run commit
COMMIT;

Query OK, 0 rows affected (0.001 sec)

# exit MariaDB
exit;
# exit docker container
exit

@nocin nocin closed this as completed Jan 15, 2025
@nocin
Copy link
Author

nocin commented Jan 15, 2025

Just one addition, when I was running the nextcloud repair command

docker exec --user www-data nextcloud-app php /var/www/html/occ maintenance:mode --on
docker exec --user www-data nextcloud-app php /var/www/html/occ maintenance:repair
docker exec --user www-data nextcloud-app php /var/www/html/occ maintenance:mode --off

I saw in the result, that an update Job related to News got deleted. Perhaps this was the job that should have triggered the db migration?!

Image

Before I posted here, I also downgraded the news app and then triggered the news app update once more from the WebUI, but I got the same missing column error.

@Grotax
Copy link
Member

Grotax commented Jan 15, 2025

That repair step is to remove an old no longer used update job, since those are not automatically removed by Nextcloud.

You simply ran into the issue that Nextcloud updated the app and did all the steps except actually adjusting the DB schema, since Nextcloud recorded the migration already it will not try to run the migration again.

DB Schemas and data stays when you delete an app at least that is the case for News.

@nocin
Copy link
Author

nocin commented Jan 25, 2025

Hi @Grotax,

unfortunately, I have to come back to you. Alltough some feeds are updated, I noticed that most of them are not. In the logs, one error occurs:

Image

TypeError fivefilters\Readability\Nodes\NodeUtility::getNextNode(): Return value must be of type fivefilters\Readability\Nodes\DOM\DOMNode|fivefilters\Readability\Nodes\DOM\DOMComment|fivefilters\Readability\Nodes\DOM\DOMText|fivefilters\Readability\Nodes\DOM\DOMElement|fivefilters\Readability\Nodes\DOM\DOMDocument|null, fivefilters\Readability\Nodes\DOM\DOMProcessingInstruction returned Error while running background job OCA\News\Cron\UpdaterJob (id: 33551, arguments: null)

Not 100% sure that this is related to the previous issue from above, but at least this problem also exists since the last update.

If I remove a feed that is not being updated and add it again in the news app, the missing feed entries are suddenly displayed. So it seems that the feeds are simply not being updated during the cron run, but in general everything else seems to work.
Do you have any idea how I can investigate this further?

Thanks,
Nico

@Grotax
Copy link
Member

Grotax commented Jan 25, 2025

That error has to do with the full text feature not working for a feed.

You could try to disable it for the feed why exactly it happens not sure at this moment

@nocin
Copy link
Author

nocin commented Jan 25, 2025

Ok, then the error message and my current problem are not related. I just checked some of my feeds that are not updating, but none of them have full text enabled. Is there any way to "force update" a feed?
Going through all my feeds and re-adding them would be very time-consuming and would also mean, I would lose my articles marked as favorites.

For example, for the Home Assistant Blog, the last fetched post is from December, but when checking on their website there are already 4 new posts.

Image

What confuses me, is that some other feeds are still working fine.

@Grotax
Copy link
Member

Grotax commented Jan 25, 2025

Via OCC you can try to update specific feeds based on the ID.

Did you by coincidence enable the next update feature in the admin settings because that night prevent updates it would log at info level that the feed is not updated. If your nextcloud is set to only log at warning level or higher you would not see that though. That can be changed in the config file.

@nocin
Copy link
Author

nocin commented Jan 25, 2025

Switching to the info log level indeed helped. During a feed update run I could see how the error from above occurred (the error related to the full text feature) and then the update run did not continue fetching more feeds. I was expecting that the errors only appear during an update run, but instead it terminated the update run. This explains why only a few feeds were updated.
As I could not identify which feed(s) are throwing the error, I simply went through all my feeds and disabled full text on all of them, and suddenly on the next run I got 529 unread articles. Your recommendation to disable the full text feature was absolutely right!

Perhaps you can take a look on the full text feature? I think it should not crash any feed update jobs. At least, I cannot trust this feature any more and will keep it disabled. :-)

Anyway, thank you once more for the help! Been using the news app for >5 years, and this is the first time having a real issue!

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

No branches or pull requests

3 participants