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

Bug Report: Error Installing Duplicate Finder App (v1.5.0) on Nextcloud Snapd 30. (Specified key was too long) #112

Closed
MasterKeks opened this issue Dec 29, 2024 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@MasterKeks
Copy link

MasterKeks commented Dec 29, 2024

Describe the bug
Attempting to install the Duplicate Finder app (v1.5.0) on Nextcloud Hub 9 (30.0.4) fails with the following error:

An error occurred during the request. Unable to proceed.
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

The issue appears to be related to MariaDB’s default settings for key lengths in the Snap-managed environment.

To Reproduce
Steps to reproduce the behavior:
1. Open Nextcloud snapd version Hub 9 (30.0.4)
2. Navigate to the App Store.
3. Attempt to install the Duplicate Finder app (v1.5.0)
4. The installation fails with the above error.

Expected behavior
The Duplicate Finder app should install successfully without errors.

Screenshots
Error-Nextcloud-snapd

Versions
• Nextcloud: Hub 9 (30.0.4) - snapd image
• Duplicate Finder: 1.5.0

Additional context
• The issue seems related to database settings (innodb_large_prefix, innodb_file_format, and innodb_default_row_format) in the Snap-managed MariaDB environment.
• Attempts to enable Snap experimental features and repair the database did not resolve the issue:
sudo snap set nextcloud mysql.experimental-features=true sudo nextcloud.occ maintenance:repair
• Direct database access for configuration changes was not possible in Snap.

Any guidance or workaround would be appreciated!

Thanks.
MK

@MasterKeks MasterKeks added the bug Something isn't working label Dec 29, 2024
@eldertek
Copy link
Owner

Hello, fixed in v1.5.1 ;)

Copy link

Thank you for your input and suggestions! 🙌

The issue has been resolved/implemented in the latest updates. 🎉 If you have any further feedback or ideas, feel free to open a new issue or join the discussion on GitHub.

Your support helps us make Duplicate Finder even better—thank you for being part of our journey! 🚀

If you haven't already, don't forget to ⭐ star the project on GitHub. Your support means the world to us and keeps the project thriving!

@MasterKeks
Copy link
Author

MasterKeks commented Dec 29, 2024

Hello, fixed in v1.5.1 ;)

Hey @eldertek,

Thanks for your fast response. Just updated everything to the newest version, but sadly still encounter the same issue, even with version 1.5.1:

Error-Nextcloud-snapd_1_5_1

I think its more related to settings in the nextcloud snapd package. But do you still have an idea to fix it?

Thanks.
MK

@eldertek
Copy link
Owner

Hi @MasterKeks,

Thanks for the update, and sorry to hear the issue persists with v1.5.1.

The error likely stems from MariaDB limitations in the Snap-managed environment (key length > 3072 bytes). Normally, this can be resolved by adjusting innodb_large_prefix, innodb_file_format, and innodb_default_row_format, but Snap restricts direct configuration.

Suggested Steps:

  1. Ensure both Nextcloud Snap (30.0.4) and MariaDB are fully updated.
  2. Retry enabling experimental features and repairing:
    sudo snap set nextcloud mysql.experimental-features=true
    sudo nextcloud.occ maintenance:repair
  3. Consider opening a discussion with the Snap or Nextcloud team, as this appears tied to Snap’s database limitations.

Alternative:

If feasible, switch to a non-Snap Nextcloud installation for full control over MariaDB settings.

Let us know if you have more details—happy to assist further!

Best,
Johannes

@Crell
Copy link

Crell commented Dec 31, 2024

I am having this problem, too. I've tried upgrading to 1.5.2 via manual download, and it still fails on upgrade. I also tried manually downgrading to 1.4.1, and I'm still getting the same error! As a result, my instance is offline and I am unclear how to resolve it.

I am on Ubuntu 24.04 with PHP 8.3 and MySQL 8.0. I am not using any snaps.

It sounds like the suggestion is to "adjust" the MySQL settings, but I am not clear what they should be adjusted to...

@eldertek eldertek reopened this Dec 31, 2024
@github-actions github-actions bot deleted a comment from eldertek Dec 31, 2024
Copy link

To help us better understand and diagnose the issue, please provide your Nextcloud logs by following these steps:

  1. Enable debug logging in your config.php file:
'debug' => true,
  1. Clear existing logs to ensure we only see relevant information:
# For standard installations:
sudo rm /var/www/nextcloud/data/nextcloud.log

# For Snap installations:
sudo rm /var/snap/nextcloud/current/nextcloud/data/nextcloud.log
  1. Reproduce the issue you're experiencing.

  2. Collect and share the contents of your new nextcloud.log file.

  3. After sharing the logs, remember to disable debug mode:

'debug' => false,

Note: Please make sure to review the logs and remove any sensitive information before sharing.

@ASerbinski
Copy link

I'm getting this error also, for v1.5.2, NC30.0.2, Rocky Linux 8 / Apache 2.4.37 / PHP 8.2.26 / MariaDB 10.3.35.

I found that changing everything in this commit where it set lengths to 768 changing it to 700 seemed to fix the issue.
c638de2

@mickeyreg
Copy link

Hi,

The same problem on NC 28.0.14 / MySQL 8.0.39 / Apache 2.4.62 (FreeBSD) / PHP 8.2.24.

Following the advice of @ASerbinski I changed 768 to ... 704 and its working.

Why? I'm not sure, but parameters of my nextcloud database are as follows:

nextcloud: utf8mb4_general_ci

It means every character in string can be 4 bytes long.

So if the max index length is 3072 bytes, it is 768 characters: 64 for user_id so the max for folder_path id 704 - both fields are used in index.

Regards,
Mickey

@Crell
Copy link

Crell commented Jan 1, 2025

I tried following @ASerbinski's approach on the 1.5.2 version, which meant I also had to modify the 1050 migration file the same way. Once I did that, I was able to get the upgrade process to complete and unlock the server.

Does the 1.5.2 try to do something other than fix the field length to address this issue? Should there be a 1.5.3 that shortens the fields down to 700?

@eldertek
Copy link
Owner

eldertek commented Jan 1, 2025

I just released version 1.5.3, which includes a hotfix for the migrations. Let me know if it works then

@mickeyreg
Copy link

Upgraded to 1.5.3 from manulay modified 1.5.2. No problems were noticed.

@Crell
Copy link

Crell commented Jan 1, 2025

Upgrading to 1.5.3 gave me an error in the UI (non-specific, just "an error happened") and left the site in maintenance mode. Switching to the CLI to run occ upgrade worked fine, though, and I was able to disable maintenance mode manually. All seems well at the moment.

@eldertek eldertek closed this as completed Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

Thank you for your input and suggestions! 🙌

The issue has been resolved/implemented in the latest updates. 🎉 If you have any further feedback or ideas, feel free to open a new issue or join the discussion on GitHub.

Your support helps us make Duplicate Finder even better—thank you for being part of our journey! 🚀

If you haven't already, don't forget to ⭐ star the project on GitHub. Your support means the world to us and keeps the project thriving!

@MasterKeks
Copy link
Author

@eldertek, Thank you for resolving the issue so quickly. Since the latest version, everything has been running smoothly for me, and I haven’t encountered any problems. It looks fantastic! I really appreciate your prompt support.

Wishing you a happy new year and all the best for the future. You have a really nice app here, helped me a lot. Keep up the great work!

Best regards,
MK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants