Giter Club home page Giter Club logo

Comments (21)

phk-r avatar phk-r commented on August 11, 2024 2

Yep, occ app:update gpoddersync. You probably need to call this together with docker exec. So the command could look like this: docker exec -it nextcloud occ app:update gpoddersync (depending on your container name). But it's possible this doesn't work yet because v3.7.1 is not yet available for you. For some reason, it always takes a bit for an update to be available for install after the new version is published to the app store.

Awesome! Worked like a charm. Thank you!

from nextcloud-gpodder.

ndurchx avatar ndurchx commented on August 11, 2024 1

Same here. Happens on MariaDB 10.3. The field is here varchar(500)

from nextcloud-gpodder.

kronna avatar kronna commented on August 11, 2024 1

Thanks for testing. Next try: changing the faulty migration step. If anyone could test this: gpoddersync.tar.gz

I still wasn't able to reproduce the error. Which versions of which databases are you using?

This fix worked! Thanks

PHP 8.0.25
Mariadb 10.3.36

from nextcloud-gpodder.

Linkinsoldier avatar Linkinsoldier commented on August 11, 2024 1

3.7.1. Did fix this for me as well, thank you!

from nextcloud-gpodder.

kpuljek avatar kpuljek commented on August 11, 2024

+1 as well. In my case it wasn't really being used so I removed it from the CLI and that brought NextCloud back online.

from nextcloud-gpodder.

Linkinsoldier avatar Linkinsoldier commented on August 11, 2024

Same for me. Unfortunately i can not remove / deactivate gpodder app via cli. Is there any way to fix it?

Exception: Database error when running migration 0006Date20221106215500 for app gpoddersync An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes

from nextcloud-gpodder.

ndurchx avatar ndurchx commented on August 11, 2024

I added the failed migration to the history, so Nextcloud thinks it is already done. Be advised, that changing things in database can lead to more problems...
INSERT INTO `oc_migrations` (`app`, `version`) VALUES ('gpoddersync', '0006Date20221106215500');

from nextcloud-gpodder.

Linkinsoldier avatar Linkinsoldier commented on August 11, 2024

Thanks, but this also sounds like cli is needed, right?

from nextcloud-gpodder.

JonOfUs avatar JonOfUs commented on August 11, 2024

Thanks for reporting. Does your Nextcloud actually go offline after the failed update?
It should, in theory, just abort the update and continue to work as before.

Working on a quick fix.

@thrillfall the problem is that url is part of the unique key and, seemingly if utf8mb4 is used, in some constellations a column with length 1000 actually uses 4000 bytes (utf8mb4) and if keys are only allowed to be as large as 3072 bytes, this throws errors. I don't know how this got through the tests, maybe we aren't using utf8mb4?
A fix would be to use prefix indexes instead, so that e.g. only the first 500 characters are used for the key. Do you have an idea on how to add such an index in Nextcloud?

from nextcloud-gpodder.

kpuljek avatar kpuljek commented on August 11, 2024

Thanks for reporting. Does your Nextcloud actually go offline after the failed update?

Mine was stuck in maintenance mode when I woke up today. That's how I even noticed it was down, sync wasn't working. After disabling it from the CLI, it soon came back online.

from nextcloud-gpodder.

ndurchx avatar ndurchx commented on August 11, 2024

Thanks for reporting. Does your Nextcloud actually go offline after the failed update? It should, in theory, just abort the update and continue to work as before.

Working on a quick fix.

@thrillfall the problem is that url is part of the unique key and, seemingly if utf8mb4 is used, in some constellations a column with length 1000 actually uses 4000 bytes (utf8mb4) and if keys are only allowed to be as large as 3072 bytes, this throws errors. I don't know how this got through the tests, maybe we aren't using utf8mb4? A fix would be to use prefix indexes instead, so that e.g. only the first 500 characters are used for the key. Do you have an idea on how to add such an index in Nextcloud?

I dont know how it is done in Nextcloud migrations. But if you change the index, the migration works. Example in MySQL:
ALTER TABLE `oc_gpodder_subscriptions` ADD UNIQUE `subscriptions_url_user` (`url`(100), `user_id`), DROP INDEX `subscriptions_url_user`;

from nextcloud-gpodder.

ndurchx avatar ndurchx commented on August 11, 2024

@JonOfUs Sorry, did not read to the end. This should work:
$table->addUniqueIndex(['url', 'user_id'], 'subscriptions_url_user'); 'length' => 100]);

from nextcloud-gpodder.

JonOfUs avatar JonOfUs commented on August 11, 2024

@ndurchx Thanks, I will try this.
You mean $table->addUniqueIndex(['url', "user_id"], 'subscriptions_url_user', ['length' => 500]);, right?
Do you have any resources on this? Couldn't find anything on the index options in Nextcloud.

from nextcloud-gpodder.

ndurchx avatar ndurchx commented on August 11, 2024

@ndurchx Thanks, I will try this. You mean $table->addUniqueIndex(['url', "user_id"], 'subscriptions_url_user', ['length' => 500]);, right? Do you have any resources on this? Couldn't find anything on the index options in Nextcloud.

Sorry, multiple copy paste errors. I just found an example at the core migrations:
$table->addIndex(['storage', 'path'], 'fs_storage_path_prefix', [], ['lengths' => [null, 64]]);

from nextcloud-gpodder.

JonOfUs avatar JonOfUs commented on August 11, 2024

Yep, just found it as well, thanks.
If anyone's interested, the syntax that should work is $table->addUniqueIndex(['url', "user_id"], 'subscriptions_url_user', [ 'lengths' => [ 500, 200 ] ]);.

I am now trying to test this. Since I can't reproduce the error (on postgres and mariadb), I'm setting up linuxserver's image right now. If anyone else wants to test as well:
gpoddersync.tar.gz

from nextcloud-gpodder.

kronna avatar kronna commented on August 11, 2024

Yep, just found it as well, thanks. If anyone's interested, the syntax that should work is $table->addUniqueIndex(['url', "user_id"], 'subscriptions_url_user', [ 'lengths' => [ 500, 200 ] ]);.

I am now trying to test this. Since I can't reproduce the error (on postgres and mariadb), I'm setting up linuxserver's image right now. If anyone else wants to test as well: gpoddersync.tar.gz

This did not work I'm still getting the same error:

Database error when running migration 0006Date20221106215500 for app gpoddersync An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes

from nextcloud-gpodder.

JonOfUs avatar JonOfUs commented on August 11, 2024

Thanks for testing. Next try: changing the faulty migration step.
If anyone could test this:
gpoddersync.tar.gz

I still wasn't able to reproduce the error. Which versions of which databases are you using?

from nextcloud-gpodder.

phk-r avatar phk-r commented on August 11, 2024

How do I apply this? My server is also stuck and says it needs an update.
Running Nextcloud 25.0.1 with docker-compose.

from nextcloud-gpodder.

JonOfUs avatar JonOfUs commented on August 11, 2024

I just published a new version that should fix the issues. You need to somehow update to that version as soon as it is available for you.
If you didn't start the update yourself, your docker image somehow did. So if you manage to re-trigger this update process, it should work again.

from nextcloud-gpodder.

phk-r avatar phk-r commented on August 11, 2024

I just published a new version that should fix the issues. You need to somehow update to that version as soon as it is available for you. If you didn't start the update yourself, your docker image somehow did. So if you manage to re-trigger this update process, it should work again.

Hmm ok. I did start the update myself, wish I would have read open issues first 😄
Now I cant login, because NC thinks an update is needed, but if I try to trigger it, I get that error mentioned in this thread.
Any way to update only Gpoddersync via CLI?

from nextcloud-gpodder.

JonOfUs avatar JonOfUs commented on August 11, 2024

Yep, occ app:update gpoddersync. You probably need to call this together with docker exec. So the command could look like this: docker exec -it nextcloud occ app:update gpoddersync (depending on your container name). But it's possible this doesn't work yet because v3.7.1 is not yet available for you. For some reason, it always takes a bit for an update to be available for install after the new version is published to the app store.

from nextcloud-gpodder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.