8000 Special character in _APP_OPENSSL_KEY_V1 env caused an error · Issue #732 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Special character in _APP_OPENSSL_KEY_V1 env caused an error #732

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

Closed
Hrdtr opened this issue Nov 6, 2020 · 2 comments
Closed

Special character in _APP_OPENSSL_KEY_V1 env caused an error #732

Hrdtr opened this issue Nov 6, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Hrdtr
Copy link
Contributor
Hrdtr commented Nov 6, 2020

🐛 Bug Report

Key with special character generated using openssl rand command caused php-fpm conf error.

Have you spent some time to check if this issue has been raised before?

No similiar issue raised in appwrite internal

To Reproduce

  1. Install appwrite using any method and configure for production
  2. Run openssl rand -base64 32 or openssl rand -base64 64 to generate base64 key
  3. Fill _APP_OPENSSL_KEY_V1 env with generated key on previous step
  4. Start the container

Expected behavior

The appwrite container should be running without any error

Actual Behavior

Php-fpm cannot pass the variable into the main configuration, here is the full log:

ox7r5 Issue a TLS certificate for master domain (localhost)
ox7r5 2020-11-05 23:34:15,183 CRIT Set uid to user 0
ox7r5 2020-11-05 23:34:15,196 INFO RPC interface ‘supervisor’ initialized
ox7r5 2020-11-05 23:34:15,196 CRIT Server ‘unix_http_server’ running without any HTTP authentication checking
ox7r5 2020-11-05 23:34:15,196 INFO supervisord started with pid 39
ox7r5 2020-11-05 23:34:16,200 INFO spawned: ‘php7-fpm’ with pid 42
ox7r5 2020-11-05 23:34:16,203 INFO spawned: ‘v1-schedule’ with pid 43
ox7r5 2020-11-05 23:34:16,209 INFO spawned: ‘v1-audits’ with pid 44
ox7r5 2020-11-05 23:34:16,214 INFO spawned: ‘v1-usage’ with pid 45
ox7r5 2020-11-05 23:34:16,223 INFO spawned: ‘v1-certificates’ with pid 46
ox7r5 2020-11-05 23:34:16,300 INFO spawned: ‘nginx’ with pid 47
ox7r5 2020-11-05 23:34:16,307 INFO spawned: ‘v1-tasks’ with pid 48
ox7r5 2020-11-05 23:34:16,479 INFO spawned: ‘v1-webhooks’ with pid 49
ox7r5 2020-11-05 23:34:16,481 INFO spawned: ‘v1-deletes’ with pid 50
ox7r5 2020-11-05 23:34:17,204 INFO success: php7-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 2020-11-05 23:34:17,204 INFO success: v1-schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 2020-11-05 23:34:17,235 INFO success: v1-audits entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 2020-11-05 23:34:17,235 INFO success: v1-usage entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 2020-11-05 23:34:17,236 INFO success: v1-certificates entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 2020-11-05 23:34:17,288 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 PHP:  syntax error, unexpected ‘=‘ in Unknown on line 1
ox7r5 2020-11-05 23:34:17,306 INFO success: v1-tasks entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 2020-11-05 23:34:17,383 INFO success: v1-webhooks entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 [05-Nov-2020 23:34:17] ERROR: Unable to include /etc/php/7.4/fpm/pool.d/www.conf from /etc/php/7.4/fpm/php-fpm.conf at line 428
ox7r5 [05-Nov-2020 23:34:17] ERROR: failed to load configuration file ‘/etc/php/7.4/fpm/php-fpm.conf’
ox7r5 [05-Nov-2020 23:34:17] ERROR: FPM initialization failed
ox7r5 2020-11-05 23:34:17,406 INFO exited: php7-fpm (exit status 78; not expected)
ox7r5 2020-11-05 23:34:17,414 INFO spawned: ‘php7-fpm’ with pid 62
ox7r5 2020-11-05 23:34:17,586 INFO success: v1-deletes entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
ox7r5 PHP:  syntax error, unexpected ‘=‘ in Unknown on line 1
ox7r5 [05-Nov-2020 23:34:17] ERROR: Unable to include /etc/php/7.4/fpm/pool.d/www.conf from /etc/php/7.4/fpm/php-fpm.conf at line 428
ox7r5 [05-Nov-2020 23:34:17] ERROR: failed to load configuration file ‘/etc/php/7.4/fpm/php-fpm.conf’
ox7r5 [05-Nov-2020 23:34:17] ERROR: FPM initialization failed
ox7r5 2020-11-05 23:34:17,620 INFO exited: php7-fpm (exit status 78; not expected)
ox7r5 2020-11-05 23:34:18,623 INFO spawned: ‘php7-fpm’ with pid 72
ox7r5 PHP:  syntax error, unexpected ‘=‘ in Unknown on line 1
ox7r5 [05-Nov-2020 23:34:18] ERROR: Unable to include /etc/php/7.4/fpm/pool.d/www.conf from /etc/php/7.4/fpm/php-fpm.conf at line 428
ox7r5 [05-Nov-2020 23:34:18] ERROR: failed to load configuration file ‘/etc/php/7.4/fpm/php-fpm.conf’
ox7r5 [05-Nov-2020 23:34:18] ERROR: FPM initialization failed
ox7r5 2020-11-05 23:34:18,680 INFO exited: php7-fpm (exit status 78; not expected)
ox7r5 2020-11-05 23:34:20,695 INFO spawned: ‘php7-fpm’ with pid 73
ox7r5 PHP:  syntax error, unexpected ‘=‘ in Unknown on line 1
ox7r5 [05-Nov-2020 23:34:20] ERROR: Unable to include /etc/php/7.4/fpm/pool.d/www.conf from /etc/php/7.4/fpm/php-fpm.conf at line 428
ox7r5 [05-Nov-2020 23:34:20] ERROR: failed to load configuration file ‘/etc/php/7.4/fpm/php-fpm.conf’
ox7r5 [05-Nov-2020 23:34:20] ERROR: FPM initialization failed
ox7r5 2020-11-05 23:34:20,832 INFO exited: php7-fpm (exit status 78; not expected)
ox7r5 2020-11-05 23:34:23,839 INFO spawned: ‘php7-fpm’ with pid 74
ox7r5 PHP:  syntax error, unexpected ‘=‘ in Unknown on line 1
ox7r5 [05-Nov-2020 23:34:23] ERROR: Unable to include /etc/php/7.4/fpm/pool.d/www.conf from /etc/php/7.4/fpm/php-fpm.conf at line 428
ox7r5 [05-Nov-2020 23:34:23] ERROR: failed to load configuration file ‘/etc/php/7.4/fpm/php-fpm.conf’
ox7r5 [05-Nov-2020 23:34:23] ```ERROR: FPM initialization failed```
ox7r5 2020-11-05 23:34:23,910 INFO exited: php7-fpm (exit status 78; not expected)
ox7r5 2020-11-05 23:34:28,002 INFO exited: php7-fpm (exit status 78; not expected)
ox7r5 2020-11-05 23:35:13,610 INFO spawned: ‘php7-fpm’ with pid 82

Your Environment

_APP_OPENSSL_KEY_V1=${openssl rand -base64 32}

Workaround

Use simple string for _APP_OPENSSL_KEY_V1 value,
or
Use combined date and sha256sum command to create a strong PSK without special characters
date | sha256sum | base64 | head -c 45; echo

@Hrdtr Hrdtr added the bug Something isn't working label Nov 6, 2020
@eldadfux
Copy link
Member
eldadfux commented Nov 6, 2020

This error was caused because of bad parsing when we passed the env var from the OS level to PHP FPM. Since in 0.7 we have dropped FPM for Swoole this is working and fine in the upcoming version.

@eldadfux eldadfux self-assigned this Nov 6, 2020
@eldadfux eldadfux added the waiting for release Fixed or implemented and waiting for a new version to be released label Nov 6, 2020
@eldadfux
Copy link
Member

Version 0.7 is out with the fix 🚀

@eldadfux eldadfux removed the waiting for release Fixed or implemented and waiting for a new version to be released label Feb 12, 2021
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

2 participants
0