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

Deploying script creating database with wrong charset that causing internal error in web interface #77

Open
gmalets opened this issue May 21, 2021 · 6 comments

Comments

@gmalets
Copy link

gmalets commented May 21, 2021

Describe the bug

According to log file https://paste.yunohost.org/raw/keguceqobi a deploying script creating database with wrong charset. As a result uploading files with diacritic or cyrillic in names using the web interface causing an error {"error": "Internal error. "}
Files without diacritic or cyrillic in names are not affected. Also, files uploaded using seafile client are uploaded correctly.

Context

  • Hardware: Linux VPS bought online tim4vps (1 core / 4GB RAM / 40GB HDD)
  • Hardware: Laptop (4 core / 2GB RAM / 500GB HDD)
  • YunoHost version: 4.2.4
  • I have access to my server: SSH & webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
  • Trying to install package: 7.0.5~ynh1/master
  • Trying to install package: 7.1.5~ynh1/testing

Steps to reproduce

yunohost app install seafile
or
yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing --force

or by web browser:

  1. Go to 'Applications'
  2. Click on green button 'Install'
  3. Search for 'Seafile'
  4. Click on green button 'Install'
  5. Wait until the end of the installation
  6. Open ssh connection to yunohost
  7. Type in command line su root
  8. Type mysql
  9. Type SHOW DATABASES;
  10. Find database names related to seafile installation (by default "ccnetdb, seafiledb, seahubdb")
  11. Type SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "ccnetdb";
  12. Type SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "seafiledb";
  13. Type SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "seahubdb";

Result of all 3 commands will be latin1

Expected behavior

  • Database charset should be utf-8
  • Uploading files by web interface with diacritic or cyrillic symbols in names should not cause internal error

Detailed manual by deploying seafile with mysql is located here

Logs

https://paste.yunohost.org/raw/keguceqobi

@Josue-T
Copy link

Josue-T commented Jul 15, 2021

Hello,

Can you try the new testing ?

Thanks

@gmalets
Copy link
Author

gmalets commented Jul 20, 2021

I did execute the command:
sudo yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing

Command line output:

sudo yunohost app install https://github.com/YunoHost-Apps/seafile_ynh/tree/testing
DANGER! This app is not part of YunoHost's app catalog. Installing third-party apps may compromise the integrity and security of your system. You should probably NOT install it unless you know what you are doing. NO SUPPORT will be provided if this app doesn't work or breaks your system… If you are willing to take that risk anyway, type 'Yes, I understand': Yes, I understand
Choose the domain where this app should be installed [zcloud.local | trilium.zcloud.local] (default: zcloud.local):
Choose the path where this app should be installed (default: /seafile):
Choose a name (3 - 15 letters or digits) (default: Seafile):
Choose an administrator user for this app [user100] (default: user100):
Enter a password for the administrator:
Should this app be exposed to anonymous visitors? [yes | no] (default: yes):
Info: Installing seafile...
Info: [....................] > Validating installation parameters...
Info: [....................] > Finding available ports...
Info: [+...................] > Storing installation settings...
Info: [#...................] > Creating base directory...
Info: [#+..................] > Configuring system user...
Info: [##+++...............] > Installing dependencies...
Warning: pandas 1.3.0 has requirement numpy>=1.17.3, but you'll have numpy 1.16.2 which is incompatible.
Warning: networkx 2.6.1 has requirement matplotlib>=3.3, but you'll have matplotlib 3.0.2 which is incompatible.
Warning: networkx 2.6.1 has requirement numpy>=1.19, but you'll have numpy 1.16.2 which is incompatible.
Warning: networkx 2.6.1 has requirement scipy!=1.6.1,>=1.5, but you'll have scipy 1.1.0 which is incompatible.
Warning: scikit-image 0.18.2 has requirement numpy>=1.16.5, but you'll have numpy 1.16.2 which is incompatible.
Info: [#####+++............] > Installing sources files...
Info: [########............] > Configuring MySQL database...
Info: [########++..........] > Configuring application...
Info: [##########..........] > Configuring a systemd service...
Info: [##########+.........] > Configuring nginx...
Info: [###########.........] > Protecting directory...
Info: [###########+........] > Configuring permissions...
Info: [############........] > Configuring log rotation...
Info: [############+.......] > Stoping services...
Info: [#############++.....] > Starting seafile services...
Info: The service seafile has correctly executed the action start.
Info: The service seahub has correctly executed the action start.
Info: [###############++++.] > Configuring fail2ban...
Warning: Packagers: using --others_var is unecessary since YunoHost 4.2
Info: The service fail2ban has correctly executed the action reload-or-restart.
Info: [####################] > Installation of seafile completed
Success! Installation completed

Debug output:
https://paste.yunohost.org/raw/pabahaciso

After install nothing happened.
Steps to reproduce still returns "latin1" encoding of databases and still causing an error {"error": "Internal error. "}

@Josue-T
Copy link

Josue-T commented Jul 20, 2021

Hello,

What is the result of the command locale ?

@gmalets
Copy link
Author

gmalets commented Jul 20, 2021

[email protected]:~# locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

The default MySQL server character set and collation are latin1 and latin1_swedish_ci , but you have to specify character sets according to official documentation I mentioned in first post https://manual.seafile.com/deploy/using_mysql/#prepare-mysql-databases

and edit file in repo "scripts/install" https://github.com/YunoHost-Apps/seafile_ynh/blob/testing/scripts/install (line 98, 99, 100)

@Josue-T
Copy link

Josue-T commented Jul 22, 2021

Maybe you can try to backport on your install this fix on your instance to see if it fix the issue. The file that I modified is in /usr/share/yunohost/helpers.d/mysql in your server.

@Josue-T
Copy link

Josue-T commented Oct 26, 2022

cf: YunoHost/issues#1868

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

2 participants