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

Worker threads need static files #1599

Closed
toolness opened this Issue Oct 10, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@toolness
Contributor

toolness commented Oct 10, 2017

Thanks to @jseppi's detective work, it appears that our worker processes, which process region 10 bulk upload data, are crashing because they need to send emails which link to our static assets:

2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR Traceback (most recent call last):
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR   File "/home/vcap/deps/0/python/lib/python3.6/site-packages/rq/worker.py", line 700, in perform_job
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR     rv = job.perform()
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR   File "/home/vcap/deps/0/python/lib/python3.6/site-packages/rq/job.py", line 500, in perform
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR     self._result = self.func(*self.args, **self.kwargs)
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR   File "/home/vcap/app/data_capture/jobs.py", line 77, in process_bulk_upload_and_send_email
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR     email.bulk_upload_failed(upload_source, tb)
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR   File "/home/vcap/app/data_capture/email.py", line 123, in wrapped
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR     return func(template, *args, **kwargs)
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR   File "/home/vcap/app/data_capture/email.py", line 288, in bulk_upload_failed
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR     to=[upload_source.submitter.email],
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR   File "/home/vcap/app/data_capture/email.py", line 84, in send_mail
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR     plaintext_message, html_message = render_mail(template, ctx)
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR   File "/home/vcap/app/data_capture/email.py", line 54, in render_mail
   2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR     html_message = render_to_string(template, html_ctx)
2017-10-06T06:32:12.47-0700 [APP/PROC/WEB/0] ERR ValueError: The file 'frontend/images/calc_logo_blue.png' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f9ade510e80>.

@jseppi thinks we just have to remove the DISABLE_COLLECTSTATIC: "1" lines from all the manifest-*.yml files to fix this.

@jseppi

This comment has been minimized.

Contributor

jseppi commented Oct 10, 2017

I think this used to work because in Travis, the collectstatic assets were available on the build machine's filesystem and got pushed to cloud.gov when the worker apps were deployed. That's not happening with the changes to the deployment scripts in Circle though.

@toolness

This comment has been minimized.

Contributor

toolness commented Oct 10, 2017

Oh got it. Can/should we change the Circle deployment scripts to work the same way Travis' did, or should we fix it the other way?

@jseppi

This comment has been minimized.

Contributor

jseppi commented Oct 10, 2017

I think fixing it the other way is more straightforward TBH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment