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

2.27.3 throws exception when executed on command line on the first-time #1085

Closed
leojonathanoh opened this issue Apr 13, 2023 · 6 comments
Closed

Comments

@leojonathanoh
Copy link

leojonathanoh commented Apr 13, 2023

Describe the bug

2.27.3 throws exception when executed on command line on the first-time fresh installation with the snappymail data directory unpopulated, whereas it worked on <= 2.27.2. Discovered in #44

Seems to be caused by dd74759. This prevents the config file from being generated the first time in docker #965.

To Reproduce
Steps to reproduce the behavior:

php /snappymail/index.php

Expected behavior

No exception

Screenshots

On 2.27.3:

$ docker run -e DEBUG=true --rm -it  leojonathanoh/snappymail:pr-1-acf2315
+ UPLOAD_MAX_SIZE=25M
+ MEMORY_LIMIT=128M
+ SECURE_COOKIES=true
+ sed -i 's/<UPLOAD_MAX_SIZE>/25M/g' /usr/local/etc/php-fpm.d/php-fpm.conf /etc/nginx/nginx.conf
+ sed -i 's/<MEMORY_LIMIT>/128M/g' /usr/local/etc/php-fpm.d/php-fpm.conf
+ '[' true '=' true ]
+ echo '[INFO] Secure cookies activated'
[INFO] Secure cookies activated
+ echo 'session.cookie_httponly = On'
+ echo 'session.cookie_secure = On'
+ echo 'session.use_only_cookies = On'
+ echo '[INFO] Setting permissions on /var/lib/snappymail'
[INFO] Setting permissions on /var/lib/snappymail
+ chown -R www-data:www-data /var/lib/snappymail/
+ chmod 550 /var/lib/snappymail/
+ find /var/lib/snappymail/ -type d -exec chmod 750 '{}' ';'
+ SNAPPYMAIL_CONFIG_FILE=/var/lib/snappymail/_data_/_default_/configs/application.ini
+ '[' '!' -f /var/lib/snappymail/_data_/_default_/configs/application.ini ]
+ echo '[INFO] Creating default Snappymail configuration: /var/lib/snappymail/_data_/_default_/configs/application.ini'
[INFO] Creating default Snappymail configuration: /var/lib/snappymail/_data_/_default_/configs/application.ini
+ EXITCODE=
+ su - www-data -s /bin/sh -c 'php /snappymail/index.php'
+ EXITCODE=255
+ '[' -n 255 ]
+ cat /tmp/out

Fatal error: Uncaught TypeError: RainLoop\Service::Handle(): Return value must be of type bool, null returned in /snappymail/snappymail/v/2.27.3/app/libraries/RainLoop/Service.php:17
Stack trace:
#0 /snappymail/snappymail/v/2.27.3/include.php(143): RainLoop\Service::Handle()
#1 /snappymail/index.php(11): include('/snappymail/sna...')
#2 {main}
  thrown in /snappymail/snappymail/v/2.27.3/app/libraries/RainLoop/Service.php on line 17
+ exit 255

Contrast with 2.27.2 which works:

$ docker run -e DEBUG=true --rm -it leojonathanoh/snappymail:pr-1-46dc7df

Please complete the following information:

  • Browser: [e.g. chromium 100, firefox 100, safari 14, mobile]
  • IMAP daemon: [e.g. courier, dovecot]
  • PHP version: 8.1
  • SnappyMail Version: 2.27.3
  • Mode: [e.g. standalone, nextcloud, cyberpanel, docker] docker

Debug/logging information
Place them here (few lines) or as attachments (many lines)

Additional context
Add any other context about the problem here.

@leojonathanoh leojonathanoh changed the title 2.27.3 throws exception when executed on command line 2.27.3 throws exception when executed on command line on the first-time Apr 13, 2023
@leojonathanoh
Copy link
Author

hey @the-djmaze, thanks for the fix. It seems to no longer produce an exception, but the data folder is still not populated, and config file not generated:

$ docker run --rm -it leojonathanoh/snappymail:pr-1-65533f9 sh
/snappymail # apk add tree
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tree (2.0.4-r0)
Executing busybox-1.35.0-r29.trigger
OK: 105 MiB in 85 packages
/snappymail # cd /var/lib/snappymail/
/var/lib/snappymail # tree .
.
├── README.md
└── VERSION

0 directories, 2 files
/var/lib/snappymail # /entrypoint.sh 
[INFO] Secure cookies activated
[INFO] Snappymail version: 2.27.3
[INFO] Setting permissions on /var/lib/snappymail
[INFO] Creating default Snappymail configuration: /var/lib/snappymail/_data_/_default_/configs/application.ini
[INFO] Overriding values in snappymail configuration: /var/lib/snappymail/_data_/_default_/configs/application.ini
sed: /var/lib/snappymail/_data_/_default_/configs/application.ini: No such file or directory
/var/lib/snappymail # tree .
.
├── INSTALLED
├── README.md
├── SALT.php
├── VERSION
├── _data_
│   └── _default_
│       ├── configs
│       ├── domains
│       │   ├── 1ae2c02f3722.json
│       │   ├── default.json
│       │   └── disabled
│       ├── plugins
│       └── storage
├── index.html
└── index.php

6 directories, 9 files
/var/lib/snappymail # 

@the-djmaze
Copy link
Owner

Correct, as there is a problem due to Nextcloud crashing that conflicts here.
Will try to find a workaround.

@leojonathanoh
Copy link
Author

hmm ok, i guess we'll have to wait and see for a fix.

@the-djmaze
Copy link
Owner

the-djmaze commented Apr 18, 2023

This commit has changes for it ad07c5b

@leojonathanoh
Copy link
Author

hmm let me try it

@leojonathanoh
Copy link
Author

it actually works now, thanks for the fix! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants