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

Docker container cannot output log types and cannot enable the email sending function #383

Open
1 task done
fengluo2 opened this issue Sep 15, 2024 · 4 comments
Open
1 task done
Labels
setup Runtime environment or usage issue

Comments

@fengluo2
Copy link

fengluo2 commented Sep 15, 2024

Version

5.2.0

Details & Steps to reproduce

The image is from dockerhub, and there is no log of sending emails.
Click test to send, and you can see from the log that the time is obviously slower than other requests, and it is being processed.
The log level debug is specified, but the output log is still info.
Docker env config:

APP_DEBUG="true"
APP_ENV="local"
APP_KEY="----"
APP_NAME="2FAuth"
APP_URL="----"
AUTHENTICATION_GUARD="web-guard"
AUTHENTICATION_LOG_RETENTION=365
AUTH_PROXY_HEADER_FOR_EMAIL=""
AUTH_PROXY_HEADER_FOR_USER=""
BROADCAST_DRIVER="log"
CACHE_DRIVER="file"
DB_DATABASE="/srv/database/database.sqlite"
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
HOST_IP="127.0.0.1"
IS_DEMO_APP="false"
LOGIN_THROTTLE=5
LOG_CHANNEL="daily"
LOG_LEVEL="debug"
MAIL_ENCRYPTION="ssl"
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="----"
MAIL_HOST="smtp.163.com"
MAIL_MAILER="smtp"
MAIL_PASSWORD="----"
MAIL_PORT=465
MAIL_USERNAME="[email protected]"
MAIL_VERIFY_SSL_PEER="true"
MEMORY_LIMIT=0
MIX_ENV="local"
OPENID_AUTHORIZE_URL=""
OPENID_CLIENT_ID=""
OPENID_CLIENT_SECRET=""
OPENID_TOKEN_URL=""
OPENID_USERINFO_URL=""
PROXY_FOR_OUTGOING_REQUESTS=""
PROXY_LOGOUT_URL=""
PUSHER_APP_CLUSTER="mt1"
PUSHER_APP_ID=""
PUSHER_APP_KEY=""
PUSHER_APP_SECRET=""
QUEUE_DRIVER="sync"
REDIS_HOST="redis"
REDIS_PORT=6379
SESSION_DRIVER="file"
SESSION_LIFETIME=120
SITE_OWNER="[email protected]"
THROTTLE_API=60
TRUSTED_PROXIES=""
WEBAUTHN_ID=""
WEBAUTHN_NAME="2FAuth"
WEBAUTHN_USER_VERIFICATION="preferred"

Is it a problem with my configuration?

Expectation

I can specify the log level and send emails

Error & Logs

Running version 5.2.0 commit a707ad3 built on 2024-05-29T14:27:28Z
supervisord version: v0.6.8
PHP 8.2.19 (fpm-fcgi) (built: May  9 2024 19:31:11)
nginx version: nginx/1.24.0
DB_DATABASE sets with default path, we will use a symlink
Actual db file will be /2fauth/database.sqlite
/srv/database/database.sqlite is now a symlink to /2fauth/database.sqlite

   INFO  Clearing cached bootstrap files.  

  events ............................................................ 1ms DONE
  views ............................................................. 4ms DONE
  cache ............................................................. 2ms DONE
  route ............................................................. 0ms DONE
  config ............................................................ 0ms DONE
  compiled .......................................................... 0ms DONE


   INFO  Configuration cached successfully.  


   INFO  Routes cached successfully.  


   INFO  Blade templates cached successfully.  

time="2024-09-15T16:56:37Z" level=info msg="load configuration from file" file=/etc/supervisor/supervisord.conf
172.18.0.1 - - [15/Sep/2024:16:58:35 +0000] "GET /admin/app HTTP/1.1" 200 2848 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:38 +0000] "GET /admin/app HTTP/1.1" 200 2848 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:43 +0000] "GET /build/assets/app-BsP-5XS6.js HTTP/1.1" 200 292995 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:48 +0000] "GET /build/assets/app-DENUQqjX.css HTTP/1.1" 200 274743 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:50 +0000] "GET /api/v1/user HTTP/1.1" 200 714 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:51 +0000] "GET /manifest.json HTTP/1.1" 200 711 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:52 +0000] "GET /api/v1/twofaccounts HTTP/1.1" 200 12 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:53 +0000] "GET /build/assets/php_zh-DmpimvBD.js HTTP/1.1" 200 49617 "https://-----/build/assets/app-BsP-5XS6.js" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:55 +0000] "GET /api/v1/groups HTTP/1.1" 200 66 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:55 +0000] "GET /api/v1/settings HTTP/1.1" 200 334 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:56 +0000] "GET /favicon.png HTTP/1.1" 200 443 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:58:57 +0000] "GET /system/infos HTTP/1.1" 200 554 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:16:59:14 +0000] "POST /system/test-email HTTP/1.1" 200 27 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:04 +0000] "GET /admin/app HTTP/1.1" 200 2848 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:05 +0000] "GET /api/v1/user HTTP/1.1" 200 714 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:05 +0000] "GET /api/v1/twofaccounts HTTP/1.1" 200 12 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:06 +0000] "GET /api/v1/groups HTTP/1.1" 200 66 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:09 +0000] "GET /manifest.json HTTP/1.1" 200 711 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:11 +0000] "GET /api/v1/settings HTTP/1.1" 200 334 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:18 +0000] "GET /system/infos HTTP/1.1" 200 554 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
172.18.0.1 - - [15/Sep/2024:17:00:31 +0000] "POST /system/test-email HTTP/1.1" 200 27 "https://-----/admin/app" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"

Execution environment

Date: Mon, 16 Sep 2024 01:00:18 +0800
userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Version: 5.2.0
Environment: local
Install path: /
Debug: true
Cache driver: file
Log channel: daily
Log level:
DB driver: sqlite
PHP version: 8.2.19
Operating system: Linux
interface: fpm-fcgi
Auth guard: web-guard
webauthn user verification: preferred
Trusted proxies: none
lastRadarScan: 1970-01-01 00:00:00

Containerization

  • Docker

Additional information

No response

@Bubka
Copy link
Owner

Bubka commented Sep 16, 2024

Hi,
What's the pb exactly? Email sending is not working at all? Or it's the log level that does not behave as expected?

FYI, a successful test email sending only logs one line: Notification of type TestEmailSettingNotification sent via channel [channelName] to user ID #[userid] (with log level info)

The log level debug is specified, but the output log is still info

I'm afraid you've misunderstood how the log system works. The LOG_LEVEL specified in your .env configuration determines which log lines are written to the logs: Each log line is defined with a log level in the application codebase. The LOG_LEVEL env var tells the app the minimum level to log.

For example, if you set LOG_LEVEL=debug, all possible log lines will be written to the log channel as debug is the lower level. In short, it tells the app "Hey, log everything, from debug lines to emergency lines"
But if you set LOG_LEVEL=info, only informational log lines and higher will be written to the log channel.

You can find all log levels with the severity order here: https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1

@fengluo2
Copy link
Author

fengluo2 commented Sep 17, 2024

yes,so setting LOG_LEVEL=debug,but not having email notification log. @Bubka

@Bubka
Copy link
Owner

Bubka commented Sep 18, 2024

hum, I don't think ssl is a valid value for MAIL_ENCRYPTION. Try tls instead.

@Bubka Bubka added the setup Runtime environment or usage issue label Sep 19, 2024
@fengluo2
Copy link
Author

Nothing happened...I'll try Google Mail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
setup Runtime environment or usage issue
Projects
None yet
Development

No branches or pull requests

2 participants