SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
2.99k stars 1.22k forks source link

Minio console unaccessable with spaces in root password #5428

Closed LukasKnuth closed 1 year ago

LukasKnuth commented 1 year ago

Is this a new Bug?

Package Name

minio

Package Version

2022.09.07-15

Device Model

DS215j

Device Architecture

ARMv7

Firmware Version

DSM 6.2.4-25556 Update 6

What happened?

When installing the minio package from the Synology Community repo, the Wizard prompts you to pick a root user name and password.

I used an autogenerated password which had a space in it, which caused the installation to complete successfully and the service to starts, but trying to log into the console UI (browser) always shows "invalid login".

I was able to fix this after the installation by SSHing into the Diskstation and modifying /var/packages/minio/etc/installer-variables to change the WIZARD_ROOT_PASSWORD line, using a password without spaces.

Reproduction steps

1. Install the "minio" package
2. In the Wizard, pick a root password with a space in it
3. The installation completes successfully and the service starts
4. Navigate to http://<NAS-IP>:9001
5. Using the picked root username/password, you're not able to login ("invalid login")

Install Log

2022/09/13 21:54:30 install minio 2022.09.07-15 Begin preinst
2022/09/13 21:54:30 Begin reload_inst_variables
2022/09/13 21:54:30 End reload_inst_variables
2022/09/13 21:54:30 Begin initialize_variables
2022/09/13 21:54:30 End initialize_variables
2022/09/13 21:54:30 ===> Step preinst. USER=minio GROUP=sc-minio SHARE_PATH=minio
2022/09/13 21:54:30 install minio 2022.09.07-15 End preinst ret=[0]
2022/09/13 21:54:30 install minio 2022.09.07-15 Begin /bin/rm -rf /volume1/@appstore/minio
2022/09/13 21:54:30 install minio 2022.09.07-15 End /bin/rm -rf /volume1/@appstore/minio ret=[0]
2022/09/13 21:54:30 install minio 2022.09.07-15 Begin /bin/mv -f /volume1/@tmp/pkginstall/package /volume1/@appstore/minio
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/mv -f /volume1/@tmp/pkginstall/package /volume1/@appstore/minio ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/rm -rf /var/packages/minio
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/rm -rf /var/packages/minio ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/mkdir -p /var/packages/minio
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/mkdir -p /var/packages/minio ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/mv -f /volume1/@tmp/pkginstall/INFO /var/packages/minio/INFO
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/mv -f /volume1/@tmp/pkginstall/INFO /var/packages/minio/INFO ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/rm -rf /var/packages/minio/scripts
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/rm -rf /var/packages/minio/scripts ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/mv -f /volume1/@tmp/pkginstall/scripts /var/packages/minio/scripts
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/mv -f /volume1/@tmp/pkginstall/scripts /var/packages/minio/scripts ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/rm -rf /var/packages/minio/WIZARD_UIFILES
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/rm -rf /var/packages/minio/WIZARD_UIFILES ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/mv -f /volume1/@tmp/pkginstall/WIZARD_UIFILES /var/packages/minio/WIZARD_UIFILES
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/mv -f /volume1/@tmp/pkginstall/WIZARD_UIFILES /var/packages/minio/WIZARD_UIFILES ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/rm -rf /var/packages/minio/conf
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/rm -rf /var/packages/minio/conf ret=[0]
2022/09/13 21:54:31 install minio 2022.09.07-15 Begin /bin/mv -f /volume1/@tmp/pkginstall/conf /var/packages/minio/conf
2022/09/13 21:54:31 install minio 2022.09.07-15 End /bin/mv -f /volume1/@tmp/pkginstall/conf /var/packages/minio/conf ret=[0]
2022/09/13 21:54:42 install minio 2022.09.07-15 Begin postinst
2022/09/13 21:54:42 Begin reload_inst_variables
2022/09/13 21:54:42 End reload_inst_variables
2022/09/13 21:54:42 Begin initialize_variables
2022/09/13 21:54:42 End initialize_variables
2022/09/13 21:54:42 ===> Step postinst. USER=minio GROUP=sc-minio SHARE_PATH=minio
2022/09/13 21:54:42 Begin save_wizard_variables
2022/09/13 21:54:42 End save_wizard_variables
2022/09/13 21:54:43 Adding 'sc-minio' to 'sc-minio'
2022/09/13 21:54:44 Group Name: [sc-minio]
2022/09/13 21:54:44 Group Type: [AUTH_LOCAL]
2022/09/13 21:54:44 Group ID:   [65538]
2022/09/13 21:54:44 Group Members:
2022/09/13 21:54:44 0:[sc-minio]
2022/09/13 21:54:44 Configuring minio
2022/09/13 21:54:44 Get Share defualt config failed.
2022/09/13 21:54:44 Skip granting 'sc-minio' group permissions on /minio as the directory does not reside in '/volumeX'. Set manually if needed.
2022/09/13 21:54:45 Begin service_postinst
2022/09/13 21:54:45 End service_postinst
2022/09/13 21:54:45 Granting 'sc-minio' unix ownership on /volume1/@appstore/minio/var
2022/09/13 21:54:45 install minio 2022.09.07-15 End postinst ret=[0]
2022/09/13 21:54:45 install minio 2022.09.07-15 Begin /bin/rm -rf /volume1/@tmp/pkginstall
2022/09/13 21:54:45 install minio 2022.09.07-15 End /bin/rm -rf /volume1/@tmp/pkginstall ret=[0]
2022/09/13 21:54:51 install minio 2022.09.07-15 Begin start-stop-status start
2022/09/13 21:54:51 install minio 2022.09.07-15 End start-stop-status start ret=[0]
2022/09/13 22:18:50 stop minio 2022.09.07-15 Begin start-stop-status stop
2022/09/13 22:18:51 stop minio 2022.09.07-15 End start-stop-status stop ret=[0]
2022/09/13 22:19:10 start minio 2022.09.07-15 Begin start-stop-status start
2022/09/13 22:19:11 start minio 2022.09.07-15 End start-stop-status start ret=[0]
2022/09/13 22:20:30 stop minio 2022.09.07-15 Begin start-stop-status stop
/var/packages/minio/scripts/service-setup: line 46: declare: `space"=': not a valid identifier
2022/09/13 22:20:31 stop minio 2022.09.07-15 End start-stop-status stop ret=[0]
2022/09/13 22:20:51 start minio 2022.09.07-15 Begin start-stop-status start
/var/packages/minio/scripts/service-setup: line 46: declare: `space"=': not a valid identifier
2022/09/13 22:20:51 start minio 2022.09.07-15 End start-stop-status start ret=[0]
2022/09/13 22:21:28 start minio 2022.09.07-15 Begin start-stop-status stop
/var/packages/minio/scripts/service-setup: line 46: declare: `space"=': not a valid identifier
2022/09/13 22:21:29 start minio 2022.09.07-15 End start-stop-status stop ret=[0]
2022/09/13 22:21:30 start minio 2022.09.07-15 Begin start-stop-status start
/var/packages/minio/scripts/service-setup: line 46: declare: `space"=': not a valid identifier
2022/09/13 22:21:30 start minio 2022.09.07-15 End start-stop-status start ret=[0]
2022/09/13 22:23:35 start minio 2022.09.07-15 Begin start-stop-status stop
/var/packages/minio/scripts/service-setup: line 46: declare: `more"=': not a valid identifier
2022/09/13 22:23:35 start minio 2022.09.07-15 End start-stop-status stop ret=[0]
2022/09/13 22:23:37 start minio 2022.09.07-15 Begin start-stop-status start
/var/packages/minio/scripts/service-setup: line 46: declare: `more"=': not a valid identifier
2022/09/13 22:23:38 start minio 2022.09.07-15 End start-stop-status start ret=[0]
2022/09/13 22:37:41 start minio 2022.09.07-15 Begin start-stop-status stop
2022/09/13 22:37:42 start minio 2022.09.07-15 End start-stop-status stop ret=[0]
2022/09/13 22:37:45 start minio 2022.09.07-15 Begin start-stop-status start
2022/09/13 22:37:45 start minio 2022.09.07-15 End start-stop-status start ret=[0]

Service Log

No response

Other Logs

No response

LukasKnuth commented 1 year ago

Note that the

declare: `space"=': not a valid identifier

lines from the installer log could also be a result of me fucking around with the variables written by the installer to get it working.

I have looked at the installer script and the way that variables are sourced from the files and it looks okay to me. I don't know too much about bash scripting though...

Maybe this could be fixed by disallowing spaces in the wizard regex, as show in #4933

hgy59 commented 1 year ago

@LukasKnuth thanks for reporting this issue.

5430 has a fix for this. If you want to fix it for your installed minio package, you have to edit the file /var/packages/minio/scripts/functions and modify the function reload_inst_variables with the changes of the PR.