Skip to content

[Bug]: DbalException: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: ".@_thumb" #52540

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

Open
5 of 8 tasks
lhsei opened this issue Apr 29, 2025 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 31-feedback bug feature: previews and thumbnails needs info

Comments

@lhsei
Copy link

lhsei commented Apr 29, 2025

⚠️ This issue respects the following points: ⚠️

Bug description

Hello,

in my Nextcloud-AIO-instance the following error occurs regularly:

_DbalException An exception occurred while executing a query: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: ".@_thumb" CONTEXT: parallel worker
Error while running background job OC\Preview\BackgroundCleanupJob (id: 392, arguments: null)

The error seems be related to a cron job.

Steps to reproduce

  1. Install Nextcloud AIO

Expected behavior

No error occurs on cleaning backgroundjobs

Nextcloud Server version

31

Operating system

Other

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

{"reqId":"IDjuRFWm7rYKqJ0n3G53","level":3,"time":"2025-04-29T13:21:17+00:00","remoteAddr":"","user":false,"app":"core","method":"","url":"/owncloud/cron.php","message":"Error while running background job OC\\Preview\\BackgroundCleanupJob (id: 392, arguments: null)","userAgent":"--","version":"31.0.4.1","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred while executing a query: SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for type bigint: \".@__thumb\"","Code":7,"Trace":[{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":53,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::","args":[{"__class__":"Doctrine\\DBAL\\Exception\\DriverException"},"","SELECT `a`.`name` FROM `*PREFIX*filecache` `a` LEFT JOIN `*PREFIX*filecache` `b` ON CAST(`a`.`name` AS BIGINT) = `b`.`fileid` WHERE (`a`.`storage` = :dcValue1) AND (`b`.`fileid` IS NULL) AND (`a`.`path` LIKE :dcValue2) AND (`a`.`mimetype` = :dcValue3)"]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `a`.`name` FROM `*PREFIX*filecache` `a` LEFT JOIN `*PREFIX*filecache` `b` ON CAST(`a`.`name` AS BIGINT) = `b`.`fileid` WHERE (`a`.`storage` = :dcValue1) AND (`b`.`fileid` IS NULL) AND (`a`.`path` LIKE :dcValue2) AND (`a`.`mimetype` = :dcValue3)",{"dcValue1":90,"dcValue2":"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%","dcValue3":2},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":151,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":50,"function":"getNewPreviewLocations","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":36,"function":"getDeletedFiles","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[null]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":97,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":84,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/cron.php","line":170,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]}],"File":"/var/www/html/lib/private/DB/Exceptions/DbalException.php","Line":56,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing a query: SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for type bigint: \".@__thumb\"","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1976,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},{"__class__":"Doctrine\\DBAL\\Query"}]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1918,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},{"__class__":"Doctrine\\DBAL\\Query"}]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1111,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},"SELECT \"a\".\"name\" FROM \"oc_filecache\" \"a\" LEFT JOIN \"oc_filecache\" \"b\" ON CAST(\"a\".\"name\" AS BIGINT) = \"b\".\"fileid\" WHERE (\"a\".\"storage\" = ?) AND (\"b\".\"fileid\" IS NULL) AND (\"a\".\"path\" LIKE ?) AND (\"a\".\"mimetype\" = ?)",[90,"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%",2],[2,2,2]]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":419,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT \"a\".\"name\" FROM \"oc_filecache\" \"a\" LEFT JOIN \"oc_filecache\" \"b\" ON CAST(\"a\".\"name\" AS BIGINT) = \"b\".\"fileid\" WHERE (\"a\".\"storage\" = ?) AND (\"b\".\"fileid\" IS NULL) AND (\"a\".\"path\" LIKE ?) AND (\"a\".\"mimetype\" = ?)",[90,"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%",2],[2,2,2],null]},{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT \"a\".\"name\" FROM \"oc_filecache\" \"a\" LEFT JOIN \"oc_filecache\" \"b\" ON CAST(\"a\".\"name\" AS BIGINT) = \"b\".\"fileid\" WHERE (\"a\".\"storage\" = :dcValue1) AND (\"b\".\"fileid\" IS NULL) AND (\"a\".\"path\" LIKE :dcValue2) AND (\"a\".\"mimetype\" = :dcValue3)",{"dcValue1":90,"dcValue2":"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%","dcValue3":2},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `a`.`name` FROM `*PREFIX*filecache` `a` LEFT JOIN `*PREFIX*filecache` `b` ON CAST(`a`.`name` AS BIGINT) = `b`.`fileid` WHERE (`a`.`storage` = :dcValue1) AND (`b`.`fileid` IS NULL) AND (`a`.`path` LIKE :dcValue2) AND (`a`.`mimetype` = :dcValue3)",{"dcValue1":90,"dcValue2":"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%","dcValue3":2},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":151,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":50,"function":"getNewPreviewLocations","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":36,"function":"getDeletedFiles","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[null]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":97,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":84,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/cron.php","line":170,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":87,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for type bigint: \".@__thumb\"","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::","args":[{"__class__":"PDOException","errorInfo":["22P02",7,"ERROR:  invalid input syntax for type bigint: \".@__thumb\""]}]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":419,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT \"a\".\"name\" FROM \"oc_filecache\" \"a\" LEFT JOIN \"oc_filecache\" \"b\" ON CAST(\"a\".\"name\" AS BIGINT) = \"b\".\"fileid\" WHERE (\"a\".\"storage\" = ?) AND (\"b\".\"fileid\" IS NULL) AND (\"a\".\"path\" LIKE ?) AND (\"a\".\"mimetype\" = ?)",[90,"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%",2],[2,2,2],null]},{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT \"a\".\"name\" FROM \"oc_filecache\" \"a\" LEFT JOIN \"oc_filecache\" \"b\" ON CAST(\"a\".\"name\" AS BIGINT) = \"b\".\"fileid\" WHERE (\"a\".\"storage\" = :dcValue1) AND (\"b\".\"fileid\" IS NULL) AND (\"a\".\"path\" LIKE :dcValue2) AND (\"a\".\"mimetype\" = :dcValue3)",{"dcValue1":90,"dcValue2":"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%","dcValue3":2},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `a`.`name` FROM `*PREFIX*filecache` `a` LEFT JOIN `*PREFIX*filecache` `b` ON CAST(`a`.`name` AS BIGINT) = `b`.`fileid` WHERE (`a`.`storage` = :dcValue1) AND (`b`.`fileid` IS NULL) AND (`a`.`path` LIKE :dcValue2) AND (`a`.`mimetype` = :dcValue3)",{"dcValue1":90,"dcValue2":"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%","dcValue3":2},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":151,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":50,"function":"getNewPreviewLocations","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":36,"function":"getDeletedFiles","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[null]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":97,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":84,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/cron.php","line":170,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":24,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for type bigint: \".@__thumb\"","Code":"22P02","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->","args":[null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":419,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT \"a\".\"name\" FROM \"oc_filecache\" \"a\" LEFT JOIN \"oc_filecache\" \"b\" ON CAST(\"a\".\"name\" AS BIGINT) = \"b\".\"fileid\" WHERE (\"a\".\"storage\" = ?) AND (\"b\".\"fileid\" IS NULL) AND (\"a\".\"path\" LIKE ?) AND (\"a\".\"mimetype\" = ?)",[90,"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%",2],[2,2,2],null]},{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT \"a\".\"name\" FROM \"oc_filecache\" \"a\" LEFT JOIN \"oc_filecache\" \"b\" ON CAST(\"a\".\"name\" AS BIGINT) = \"b\".\"fileid\" WHERE (\"a\".\"storage\" = :dcValue1) AND (\"b\".\"fileid\" IS NULL) AND (\"a\".\"path\" LIKE :dcValue2) AND (\"a\".\"mimetype\" = :dcValue3)",{"dcValue1":90,"dcValue2":"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%","dcValue3":2},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `a`.`name` FROM `*PREFIX*filecache` `a` LEFT JOIN `*PREFIX*filecache` `b` ON CAST(`a`.`name` AS BIGINT) = `b`.`fileid` WHERE (`a`.`storage` = :dcValue1) AND (`b`.`fileid` IS NULL) AND (`a`.`path` LIKE :dcValue2) AND (`a`.`mimetype` = :dcValue3)",{"dcValue1":90,"dcValue2":"appdata\\_oc24i3pjblm8/preview/_/_/_/_/_/_/_/%","dcValue3":2},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":151,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":50,"function":"getNewPreviewLocations","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/BackgroundCleanupJob.php","line":36,"function":"getDeletedFiles","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[]},{"file":"/var/www/html/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OC\\Preview\\BackgroundCleanupJob","type":"->","args":[null]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":97,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":84,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]},{"file":"/var/www/html/cron.php","line":170,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"}]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}}},"message":"Error while running background job OC\\Preview\\BackgroundCleanupJob (id: 392, arguments: null)","exception":{"query":"SELECT `a`.`name` FROM `*PREFIX*filecache` `a` LEFT JOIN `*PREFIX*filecache` `b` ON CAST(`a`.`name` AS BIGINT) = `b`.`fileid` WHERE (`a`.`storage` = :dcValue1) AND (`b`.`fileid` IS NULL) AND (`a`.`path` LIKE :dcValue2) AND (`a`.`mimetype` = :dcValue3)"},"CustomMessage":"Error while running background job OC\\Preview\\BackgroundCleanupJob (id: 392, arguments: null)"},"id":"6810f05099e12"}

Additional info

I have migrated my stand-alone-installation to nextcloud-aio.

@lhsei lhsei added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 29, 2025
@joshtrichards
Copy link
Member

joshtrichards commented Apr 29, 2025

It appears you may have unexpected files located within the internally managed preview appdata folders. Those .@__thumb files do not come from Nextcloud and would not normally be there.

@joshtrichards joshtrichards changed the title [Bug]: DbalException [Bug]: DbalException: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: ".@_thumb" Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 31-feedback bug feature: previews and thumbnails needs info
Projects
None yet
Development

No branches or pull requests

3 participants