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

Send mail error 500 #1164

Closed
mr-biggles opened this issue Jun 9, 2023 · 11 comments
Closed

Send mail error 500 #1164

mr-biggles opened this issue Jun 9, 2023 · 11 comments
Labels

Comments

@mr-biggles
Copy link

mr-biggles commented Jun 9, 2023

Hello,

I use docker-compose for pwpush. I have configured pwpush with the postgres backend.

But the mail configuration doesn't work.
Here you can see the variables in the settings.yml for smtp :

Can you tell me what's blocking it?

mail:
  # Email delivery errors will be shown in the application
  # Environment Variable Override: PWP__MAIL__RAISE_DELIVERY_ERRORS='false'
  raise_delivery_errors: true

  # Allows you to use a remote mail server. Just change it from its default "localhost" setting.
  # Environment Variable Override: PWP__MAIL__SMTP_ADDRESS='smtp.example.com'
  smtp_address: 'ssl0.ovh.net'

  # If your mail server requires authentication, set the username in this setting.
  # Environment Variable Override: PWP__MAIL__SMTP_USER_NAME='apikey'
  smtp_user_name: '[email protected]'

  # If your mail server requires authentication, set the password in this setting.
  # Environment Variable Override: PWP__MAIL__SMTP_PASSWORD='something@&#$'
  smtp_password: 'Password'

  # If you need to specify a HELO domain, you can do it here.
  # Environment Variable Override: PWP__MAIL__SMTP_DOMAIN='xyz.dev'
  # smtp_domain: 'myjob.fr'

  # Port of the SMTP server
  # Environment Variable Override: PWP__MAIL__SMTP_PORT='587'
  smtp_port: 465

  # If your mail server requires authentication, you need to specify the
  # authentication type here. This is a string and one of :plain (will send
  # the password in the clear), :login (will send password Base64 encoded)
  # or :cram_md5 (combines a Challenge/Response mechanism to exchange
  # information and a cryptographic Message Digest 5 algorithm to hash
  # important information)
  # Environment Variable Override: PWP__MAIL__SMTP_AUTHENTICATION='plain'
  smtp_authentication: 'plain'

  # Use STARTTLS when connecting to your SMTP server and fail if unsupported.
  # Environment Variable Override: PWP__MAIL__SMTP_STARTTLS='true'
  smtp_starttls: true

  # Detects if STARTTLS is enabled in your SMTP server and starts to use it. Defaults to true.
  # Environment Variable Override: PWP__MAIL__SMTP_ENABLE_STARTTLS_AUTO='false'
  # smtp_enable_starttls_auto: true

  # Number of seconds to wait while attempting to open a connection.
  # Environment Variable Override: PWP__MAIL__SMTP_OPEN_TIMEOUT='10'
  smtp_open_timeout: 60

  # Number of seconds to wait until timing-out a read(2) call.
  # Environment Variable Override: PWP__MAIL__SMTP_READ_TIMEOUT='10'
  smtp_read_timeout: 60

  # When using TLS, you can set how OpenSSL checks the certificate. This is
  # useful if you need to validate a self-signed and/or a wildcard certificate.
  # This can be one of the OpenSSL verify constants, :none or :peer
  # Environment Variable Override: PWP__MAIL__SMTP_OPENSSL_VERIFY_MODE='none'
  # smtp_openssl_verify_mode: 'peer'

  # Configure the e-mail address which will be shown as 'From' in emails
  # See config/initializers/devise.rb where this is used
  # Environment Variable Override: PWP__MAIL__MAILER_SENDER='"Password Pusher" <[email protected]>'
  mailer_sender: '"No Reply" <[email protected]>'

image

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Hello @mr-biggles, thanks for contributing to the Password Pusher community! We will respond as soon as possible.

@pglombardo
Copy link
Owner

Hi @mr-biggles - the only way to know for sure is to check the container output for an exception with details or it may alternatively be in a log file inside the container: /opt/PasswordPusher/logs/*.log.

Could you see if you can find an SMTP related exception in there? That should point us in the right direction.

@mr-biggles
Copy link
Author

Hello, thank you for your reply. Here is the only log I can find (private.log)

E, [2023-06-09T17:53:04.188361 #59] ERROR -- : source=rack-timeout id=8eb2654b-1911-4793-afb2-76c7c665e04f timeout=15000ms service=15000ms state=timed_out
F, [2023-06-09T17:53:04.192834 #59] FATAL -- : [8eb2654b-1911-4793-afb2-76c7c665e04f]
[8eb2654b-1911-4793-afb2-76c7c665e04f] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ):
[8eb2654b-1911-4793-afb2-76c7c665e04f]
[8eb2654b-1911-4793-afb2-76c7c665e04f] app/controllers/application_controller.rb:14:in `custom_set_locale_from_url'

I see a timeout, is the timeout SMTP?

because I'm pinging it fine though

image

@mr-biggles
Copy link
Author

For your information, the site is behind a nginx reverse proxy.

@pglombardo
Copy link
Owner

That might or might not be the cause. The middleware has a request timeout that if something goes wrong and takes longer than 15 seconds, it times out so it can serve other requests.

Are there any other exceptions in the log? Can you post the full error stack?

Another guess is that it could be a DNS timeout when trying to resolve ssl0.ovh.net. But without the full exception from the logs, it's just a guess.

@mr-biggles
Copy link
Author

That's all I have in my logs, nothing else.

Is it possible to remove authentication to upload files directly?
I filter the ip's that access this page, so it's no problem if I don't have authentication.

@pglombardo
Copy link
Owner

Is it possible to remove authentication to upload files directly?

Unfortunately not possible currently. :-/

Every error is logged in the application log. There should be one in there. Without one, it's we'd be just guessing.

Could you following the steps I outlined in this similar issue and post the results here?

That should tell us more.

@mr-biggles
Copy link
Author

Hello, here are the logs I found on the machine.

71e9e7a97a2d:/opt/PasswordPusher$ nano /opt/PasswordPusher/log/private.log bash: nano: command not found 71e9e7a97a2d:/opt/PasswordPusher$ cat /opt/PasswordPusher/log/private.log E, [2023-06-09T17:53:04.188361 #59] ERROR -- : source=rack-timeout id=8eb2654b-1911-4793-afb2-76c7c665e04f timeout=15000ms service=15000ms state=timed_out F, [2023-06-09T17:53:04.192834 #59] FATAL -- : [8eb2654b-1911-4793-afb2-76c7c665e04f] [8eb2654b-1911-4793-afb2-76c7c665e04f] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ): [8eb2654b-1911-4793-afb2-76c7c665e04f] [8eb2654b-1911-4793-afb2-76c7c665e04f] app/controllers/application_controller.rb:14:in custom_set_locale_from_url'
F, [2023-06-13T13:00:13.354146 #60] FATAL -- : [ea0b58fe-1367-4398-a77f-91bce53459d1]
[ea0b58fe-1367-4398-a77f-91bce53459d1] ActionController::RoutingError (No route matches [GET] "/remote/info"):
[ea0b58fe-1367-4398-a77f-91bce53459d1]
F, [2023-06-13T15:07:09.112818 #59] FATAL -- : [ed7020a0-ee7a-4f29-99c6-f0755ffb1b88]
[ed7020a0-ee7a-4f29-99c6-f0755ffb1b88] ActionController::RoutingError (No route matches [GET] "/remote/info"):
[ed7020a0-ee7a-4f29-99c6-f0755ffb1b88]
E, [2023-06-16T07:21:04.834986 #60] ERROR -- : source=rack-timeout id=f98bff94-7b7c-458c-a5a3-dca1e78bd089 timeout=15000ms service=15000ms state=timed_out
F, [2023-06-16T07:21:04.836724 #60] FATAL -- : [f98bff94-7b7c-458c-a5a3-dca1e78bd089]
[f98bff94-7b7c-458c-a5a3-dca1e78bd089] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ):
[f98bff94-7b7c-458c-a5a3-dca1e78bd089]
[f98bff94-7b7c-458c-a5a3-dca1e78bd089] app/controllers/application_controller.rb:14:in custom_set_locale_from_url' F, [2023-06-16T08:36:33.950046 #60] FATAL -- : [76ca89d8-5dd1-48c8-8f51-ef400f372da3] [76ca89d8-5dd1-48c8-8f51-ef400f372da3] ActionController::RoutingError (No route matches [GET] "/fr/utilisateurs"): [76ca89d8-5dd1-48c8-8f51-ef400f372da3] E, [2023-06-16T09:31:56.570053 #59] ERROR -- : source=rack-timeout id=1856c612-3bb5-4822-bbe4-6e913a11c86d timeout=15000ms service=15001ms state=timed_out F, [2023-06-16T09:31:56.576343 #59] FATAL -- : [1856c612-3bb5-4822-bbe4-6e913a11c86d] [1856c612-3bb5-4822-bbe4-6e913a11c86d] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ): [1856c612-3bb5-4822-bbe4-6e913a11c86d] [1856c612-3bb5-4822-bbe4-6e913a11c86d] app/controllers/application_controller.rb:14:in custom_set_locale_from_url'
E, [2023-06-16T09:34:47.922754 #60] ERROR -- : source=rack-timeout id=af7c0356-1a23-4638-97dd-51991d15eb1e timeout=15000ms service=15000ms state=timed_out
F, [2023-06-16T09:34:47.927319 #60] FATAL -- : [af7c0356-1a23-4638-97dd-51991d15eb1e]
[af7c0356-1a23-4638-97dd-51991d15eb1e] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ):
[af7c0356-1a23-4638-97dd-51991d15eb1e]
[af7c0356-1a23-4638-97dd-51991d15eb1e] app/controllers/application_controller.rb:14:in custom_set_locale_from_url' F, [2023-06-16T10:41:35.117132 #59] FATAL -- : [215429f5-6d68-4297-8d78-6de3dd48e9d7] [215429f5-6d68-4297-8d78-6de3dd48e9d7] ActionController::RoutingError (No route matches [GET] "/fr/utilisateurs"): [215429f5-6d68-4297-8d78-6de3dd48e9d7] E, [2023-06-16T12:45:57.411430 #59] ERROR -- : source=rack-timeout id=e0e643cb-1dbc-4a5f-9068-45addbd6ce79 timeout=15000ms service=15000ms state=timed_out F, [2023-06-16T12:45:57.413247 #59] FATAL -- : [e0e643cb-1dbc-4a5f-9068-45addbd6ce79] [e0e643cb-1dbc-4a5f-9068-45addbd6ce79] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ): [e0e643cb-1dbc-4a5f-9068-45addbd6ce79] [e0e643cb-1dbc-4a5f-9068-45addbd6ce79] app/controllers/application_controller.rb:14:in custom_set_locale_from_url'
E, [2023-06-16T15:14:08.920927 #59] ERROR -- : source=rack-timeout id=5ae29f8c-7f91-4a12-8694-03058ea5345a timeout=15000ms service=15000ms state=timed_out
F, [2023-06-16T15:14:08.925279 #59] FATAL -- : [5ae29f8c-7f91-4a12-8694-03058ea5345a]
[5ae29f8c-7f91-4a12-8694-03058ea5345a] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ):
[5ae29f8c-7f91-4a12-8694-03058ea5345a]
[5ae29f8c-7f91-4a12-8694-03058ea5345a] app/controllers/application_controller.rb:14:in custom_set_locale_from_url' E, [2023-06-19T09:28:02.803188 #59] ERROR -- : source=rack-timeout id=7dcc72a0-f1cf-4bd0-93d8-e01e149600b5 timeout=15000ms service=15001ms state=timed_out F, [2023-06-19T09:28:02.804865 #59] FATAL -- : [7dcc72a0-f1cf-4bd0-93d8-e01e149600b5] [7dcc72a0-f1cf-4bd0-93d8-e01e149600b5] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ): [7dcc72a0-f1cf-4bd0-93d8-e01e149600b5] [7dcc72a0-f1cf-4bd0-93d8-e01e149600b5] app/controllers/application_controller.rb:14:in custom_set_locale_from_url'
F, [2023-06-19T10:26:38.393819 #59] FATAL -- : [2fda4192-e934-4912-a012-9fa913cc7b68]
[2fda4192-e934-4912-a012-9fa913cc7b68] ActionController::RoutingError (No route matches [GET] "/fr/utilisateurs"):
[2fda4192-e934-4912-a012-9fa913cc7b68]
E, [2023-06-20T09:05:49.112567 #60] ERROR -- : source=rack-timeout id=bc9b844a-7e64-4978-94a9-f7f0d2941209 timeout=15000ms service=15000ms state=timed_out
F, [2023-06-20T09:05:49.115691 #60] FATAL -- : [bc9b844a-7e64-4978-94a9-f7f0d2941209]
[bc9b844a-7e64-4978-94a9-f7f0d2941209] Rack::Timeout::RequestTimeoutException (Request ran for longer than 15000ms ):
[bc9b844a-7e64-4978-94a9-f7f0d2941209]
[bc9b844a-7e64-4978-94a9-f7f0d2941209] app/controllers/application_controller.rb:14:in custom_set_locale_from_url'

@mr-biggles
Copy link
Author

Hi, I managed to get this to work with an office 365 connector and a port 25 without authentication.

I have another problem now, when I upload a file and share the link, it tells me that the link has expired.

Do you want me to open another issue ?

@pglombardo
Copy link
Owner

Good that you resolved the SMTP issues. #794 may be related to your file upload issue. I believe it has something to do when hosting with a frontend proxy. Not sure yet though.

I'm traveling for the next few weeks so I'll revisit this once I'm back.

@pglombardo
Copy link
Owner

Hi @mr-biggles given that the SMTP issue is resolved. I'm going to close this issue out.

Are you still having issue with the file uploads?

If so, could you file a new issue with instructions on how to reproduce the issue? Also include what storage backend you are using: local, amazon, gcs etc.. I'm working on improving the file uploads now. Much appreciated.

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

No branches or pull requests

2 participants