Closed johnbradley closed 4 years ago
I heard back from the DukeDS team that this 400 error was because the transfer was already accepted. I think this might be due to the state of the project not being updated in the D4S2 database.
In the logs I also saw this error before the 400 error on project accept.
[2020-03-16 16:00:19 -0400] [16] [CRITICAL] WORKER TIMEOUT (pid:21)
[2020-03-16 20:00:19 +0000] [21] [INFO] Worker exiting (pid: 21)
[2020-03-16 16:00:19 -0400] [23] [INFO] Booting worker with pid: 23
I think this timeout occurred when sending emails.
In the following code the sender_message
email was sent but not the recipient_message
and mark_accepted
was not called.
We send emails with the django.core.mail.backends.smtp.EmailBackend. The default timeout is None for the EmailBackend is no timeout. In the short term we should set this timeout to a reasonable value to allow the user to properly accept a delivery even if SMTP is slow. Long term the email should be sent in a background thread/process.
This was fixed by #226
The following error occurred when a user was accepting a transfer:
It appears this transfer eventually worked and the user was able to accept the transfer.
I am not sure why the
/project_transfers/0815f0b7-9f41-4f9e-9fb9-5c781a2afc77/accept
would fail with a 400. We don't pass the optional message field. I am wondering if this problem is on the DukeDS side.We can however fix the AttributeError that occurs when building a message for the user.