Open b0ssi opened 3 years ago
Some additional findings: Looking at the SQLite database I'm trying to migrate to MySQL and looking at the table mentioned (oc_cameraobjects_props
) I'm finding a range of entries with a four-byte unicode character prefixed that matches the hex code logged in the error (0x f0 9f 8e 82
). Doing a quick lookup it turns out it's... a birthday cake :D and it's (probably) exactly that cake that birthday events prefixed with in the calendar, so this shouldn't be rare corner case.
If this implies that this is an issue of lacking support for (multibyte) unicode during migration it's probably something that should handled as unicode in calendar entries (or in any other readable text really) is probably something that should be expected. I'm mostly guessing and extrapolating from what I can see spontaneously. Happy to provide more context where necessary. Thanks for looking into it!
Update: Guessing that 1366 mentioned in the error log might refer to the objectid
in this table, the cow that triggers this error contains the following data:
id | calendarid | objectid | name | parameter | value | calendartype |
---|---|---|---|---|---|---|
5688 |
4 |
1366 |
SUMMARY |
NULL | <string suffixed with 0x f0 9f 8e 82 > |
0 |
Terrific, thanks a ton @ChristophWurst, this was the last missing bit. There had been a few issues now resolved in past releases that I bumped into whenever I tried to migrate to MySQL, hence the bias toward suspecting bits in the business logic that might yet need to be straightened out. Would it be worth hinting at the underlying issue more explicitly in the error that gets thrown when attempting to migrate to a database that is not 4-byte enabled? In any case, thanks again; this issue is resolved and migration went through without a hitch :+1:
Would it be worth hinting at the underlying issue more explicitly in the error that gets thrown when attempting to migrate to a database that is not 4-byte enabled?
We could do this. The current admin overview page only checks the current database, so this scenario won't be detected.
This sounds like a feature request to me
For anyone that feels like implementing this, here are some clues...
The db:convert-type
command is implemented here:
https://github.com/nextcloud/server/blob/master/core/Command/Db/ConvertType.php
There's an existing utility function that can be used to check for utfmb4
The check will have to run against the $toDB
rather than the existing db:
You can see a working example of how it's used in a different occ
command here:
The existing warning used in our setup checks for the live database can probably just be used here, doing the check before running the conversion if the condition is detected:
How to use GitHub
Steps to reproduce
Bug depends on custom state SQLite database, so probably won't be easy to reproduce, but details below.
php occ db:convert-type mysql --password=<pw> --clear-schema --all-apps <user> <host> <databasename>
Expected behaviour
have migration successfully convert all tables
Actual behaviour
I get a partially successful migration, then an exception when trying to convert some field data in contacts/calendar?
Server configuration
Operating system: Debian
Web server: Apache2
Database: MariaDB (1:10.5.11-1)
PHP version: 7.4
Nextcloud version: (see Nextcloud admin page) 21.0.4
Updated from an older Nextcloud/ownCloud or fresh install: this installation dates back a good few years (~2015?) well into OwnCloud days.
Where did you install Nextcloud from: native web installer/archive
Signing status:
Signing status
``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. ```List of activated apps:
Nextcloud configuration:
Are you using external storage, if yes which one: local/smb/sftp/... no
Are you using encryption: yes/no no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... webdav
Client configuration
Browser: Firefox
Operating system: Arch Linux
Logs
most likely not relevant but please request if needed
Web server error log
most likely not relevant but please request if needed
Nextcloud log (data/nextcloud.log)
most likely not relevant but please request if needed
Browser log
most likely not relevant but please request if needed