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

NC24: InvalidArgumentException: Column "oc_bookmarks"."url" is type String, but exceeding the 4.000 length limit. #1785

Closed
4 of 8 tasks
mjz68 opened this issue Apr 2, 2022 · 19 comments

Comments

@mjz68
Copy link

mjz68 commented Apr 2, 2022

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

Meldung des Web-Updaters:

Aktualisierung auf 24.0.0 beta 2

InvalidArgumentException: Column "oc_bookmarks"."url" is type String, but exceeding the 4.000 length limit.
Detaillierte Protokollmeldungen
Update vorbereiten
Log-Level auf "debug" gesetzt
Wartungsmodus eingeschaltet
Repair MySQL collation
All tables already have the correct collation -> nothing to do
Repair SQLite autoincrement
Copy data from accounts table when migrating from ownCloud
Drop account terms table when migrating from ownCloud
Das Datenbankschema wird aktualisiert
InvalidArgumentException: Column "oc_bookmarks"."url" is type String, but exceeding the 4.000 length limit.

Steps to reproduce

Web Update

Expected behavior

Normalen Durchlauf

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

No response

Web server

Apache (supported)

Database engine version

No response

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

No response

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

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

Configuration report

No response

List of activated Apps

Aktuell nicht möglich

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@kesselb kesselb transferred this issue from nextcloud/server Apr 2, 2022
@BombTheDodongos
Copy link

I'm running into the exact same issue upgrading to 24.0.0 beta 2

@marcelklehr
Copy link
Member

Huh, this breaking change was not mentioned in the v24 issue @kesselb
Where is this documented?

also see nextcloud/server#31791

@kesselb
Copy link
Contributor

kesselb commented Apr 2, 2022

Huh, this breaking change was not mentioned in the v24 issue @kesselb

Indeed. I were not involved in Nextcloud 24 due some health issues and don't know why this new requirement is not documented.

@nursoda
Copy link

nursoda commented Apr 3, 2022

Same here while updating to NC24; system env: Arch, PHP 8.0(!), MariaDB, Redis

@nursoda
Copy link

nursoda commented Apr 3, 2022

Are we sure that this is a bookmarks app issue? To continue with the upgrade 23→24b2, I manually disabled and removed the bookmarks app and re-issued occ upgrade. The error remained, so I manually dropped all bookmarks tables. After doing so, the occ upgrade now yields

InvalidArgumentException: Column "oc_dashboard_data"."data" is type String, but exceeding the 4.000 length limit.

Disabling dashboard is possible but does not change the outcome of occ upgrade. It is not possible to remove dashboard using occ app:remove dashboard:

dashboard could not be removed as it is a shipped app

To continue with the upgrade I manually moved apps/dashboard and apps/dashboardcharts aside and dumped and dropped oc_dashboard_data from the database. Upon occ upgrade I now get

InvalidArgumentException: Column "oc_external_config"."value" is type String, but exceeding the 4.000 length limit.

Disabling files_external is possible but does not change the outcome of occ upgrade. It is also not possible to remove files_external using occ app:remove files_external since it is a shipped app – and I probably really should not remove this app. I did anyway (by moving apps/files_external aside and dumping/dropping oc_external_applicable oc_external_config oc_external_mounts oc_external_options). Next apps the updater complained about were forms and epubreader. I also uninstalled them and dumped/dropped their tables. After that, I could do the occ upgrade.

After finishing the upgrade and adding the uninstallable apps to the app_install_overwrite array in config/config.php, I could re-install those apps by

occ app:install APP
occ app:remove APP
occ app:install APP

The first install was partially necessary since only then NC recognizes that it was manually deleted.

I also could restore dashboard by installing/enabling, moving back its app directory and restoring its db content. To do the same for files_external I also had to reduce the size of the data column from 10240 to 4000:

ALTER TABLE oc_external_config MODIFY COLUMN value varchar(4000);

I now reproduced the issue after upgrading another staging instance and could solve the issue without un/installing anything by modifying the tables in the database using these commands:

ALTER TABLE oc_bookmarks MODIFY COLUMN url varchar(4000) NOT NULL;
ALTER TABLE oc_bookmarks MODIFY COLUMN title varchar(4000) NOT NULL;
ALTER TABLE oc_bookmarks MODIFY COLUMN description varchar(4000) NOT NULL;
ALTER TABLE oc_bookmarks_folders MODIFY COLUMN title varchar(4000) NOT NULL;
ALTER TABLE oc_bookmarks_folders_public MODIFY COLUMN description varchar(4000) NOT NULL;

@Thaurin
Copy link

Thaurin commented Apr 3, 2022

I also ran into the same issue just now. Is @nursoda's solution a safe workaround for now to continue the upgrade? It seems... risky.

@nursoda
Copy link

nursoda commented Apr 4, 2022

Installing a beta always is. I took the risk to be able to update PHP (to 8.1, I'm on Arch). Turns out that may have not been a good choice: At first it seemed that all instances just ran fine, but one instance is in maintenance mode the second time now for no reason I can think of. Investigating…according to the log it seems to be caused by the Backup app…disabling it.

Most probably these issues are unrelated to cropping the column length. I expect that the migrations would do just that (if the limit is kept).

@Thaurin
Copy link

Thaurin commented Apr 4, 2022

Hmm, now I'm considering a complete fresh install, unfortunately. I'm not sure I want to manually mess with the database schema like that; you never know what it might break now or in the future.

I guess you're right in that it's my own fault for installing a beta, but still. It's a very simple instance and I wonder what went wrong here, and if there's a clean fix. Until then, I can't easily access my files on some devices.

@Githopp192

This comment was marked as duplicate.

@oddmean

This comment was marked as duplicate.

@scottalanmiller

This comment was marked as duplicate.

@marcelklehr
Copy link
Member

The fix is in, once beta 3 is out and I have time, I'll make a release with v24 support.

@marcelklehr marcelklehr changed the title [Bug]: InvalidArgumentException: Column "oc_bookmarks"."url" is type String, but exceeding the 4.000 length limit. NC24: InvalidArgumentException: Column "oc_bookmarks"."url" is type String, but exceeding the 4.000 length limit. Apr 7, 2022
@scottalanmiller
Copy link

The fix is in, once beta 3 is out and I have time, I'll make a release with v24 support.

Awesome, thanks!

@nickvergessen
Copy link
Member

beta3 is out

@Githopp192
Copy link

upgrade ok - overall check shows green

some PHP errors: (when calling cron.php)

[PHP] Error: Class OCA\Bookmarks\Service\FileCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (OCP\ICache::isAvailable) at /var/www/html/nextcloud/apps/bookmarks/lib/Service/FileCache.php#17

at 2022-04-08T16:00:06+02:00

[cron] Error: Error: Call to undefined method OCA\Survey_Client\BackgroundJobs\MonthlyReport::setTimeSensitivity() at <>

  1. <>
    OCA\Survey_Client\BackgroundJobs\MonthlyReport->__construct()
  2. /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 108
    ReflectionClass->newInstanceArgs()
  3. /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 116
    OC\AppFramework\Utility\SimpleContainer->buildClass()
  4. /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 133
    OC\AppFramework\Utility\SimpleContainer->resolve()
  5. /var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 465
    OC\AppFramework\Utility\SimpleContainer->query()
  6. /var/www/html/nextcloud/lib/private/ServerContainer.php line 145
    OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
  7. /var/www/html/nextcloud/lib/private/BackgroundJob/JobList.php line 303
    OC\ServerContainer->query()
  8. /var/www/html/nextcloud/lib/private/BackgroundJob/JobList.php line 241
    OC\BackgroundJob\JobList->buildJob()
  9. /var/www/html/nextcloud/cron.php line 144
    OC\BackgroundJob\JobList->getNext()

at 2022-04-08T15:30:14+02:00

[PHP] Error: Error: file_put_contents(/media/appdata_ocxjkdoykhhr/preview/a/f/3/3/0/3/f/1897/4096-4096-max.png): failed to open stream: No such file or directory at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#292 at <>

  1. <>
    OC\Log\ErrorHandler::onError()
  2. /var/www/html/nextcloud/lib/private/Files/Storage/Local.php line 292
    file_put_contents()
  3. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 258
    OC\Files\Storage\Local->file_put_contents()
  4. /var/www/html/nextcloud/lib/private/Files/View.php line 1170
    OC\Files\Storage\Wrapper\Wrapper->file_put_contents()
  5. /var/www/html/nextcloud/lib/private/Files/View.php line 706
    OC\Files\View->basicOperation()
  6. /var/www/html/nextcloud/lib/private/Files/Node/Folder.php line 189
    OC\Files\View->file_put_contents()
  7. /var/www/html/nextcloud/lib/private/Files/SimpleFS/NewSimpleFile.php line 133
    OC\Files\Node\Folder->newFile()
  8. /var/www/html/nextcloud/lib/private/Preview/Generator.php line 346
    OC\Files\SimpleFS\NewSimpleFile->putContent()
  9. /var/www/html/nextcloud/lib/private/Preview/Generator.php line 158
    OC\Preview\Generator->getMaxPreview()
  10. /var/www/html/nextcloud/lib/private/Preview/Generator.php line 110
    OC\Preview\Generator->generatePreviews()
  11. /var/www/html/nextcloud/lib/private/PreviewManager.php line 212
    OC\Preview\Generator->getPreview()
  12. /var/www/html/nextcloud/core/Controller/PreviewController.php line 169
    OC\PreviewManager->getPreview()
  13. /var/www/html/nextcloud/core/Controller/PreviewController.php line 142
    OC\Core\Controller\PreviewController->fetchPreview()
  14. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OC\Core\Controller\PreviewController->getPreviewByFileId()
  15. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
  16. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
  17. /var/www/html/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
  18. /var/www/html/nextcloud/lib/base.php line 1023
    OC\Route\Router->match()
  19. /var/www/html/nextcloud/index.php line 36
    OC::handleRequest()

GET /core/preview?fileId=1897&x=250&y=250
from xxxx by admin at 2022-04-08T15:40:16+02:00

@nickvergessen
Copy link
Member

Background job of Survey client is fixed here: nextcloud/survey_client#128

@Githopp192
Copy link

thx Joas

@marcelklehr
Copy link
Member

Fixed by e70ccbe

@marcelklehr
Copy link
Member

https://github.com/nextcloud/bookmarks/releases/tag/v10.3.0 is now published with support for nc24

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

No branches or pull requests

10 participants