New Error with Deployment to Elastic Beanstalk via Docker

Hello all, I’ve had several Dash apps running on Amazon’s Elastic Beanstalk for a while now, however I recently had to rebuild an environment and now one of them refuses to run. The app still runs fine locally, it is only when I try to get it running on EB that it fails.

Visually, the app just starts at the ‘Loading…’ screen and spins it’s wheel for a second before giving up. I’ve even attempted to remove all functions/callbacks/and elements from the app other than a header to see if that would fix the issue.

In the logs, I’ve found two sources of potential error:

  1. A MIME type warning that I’m not too concerned about but maybe it’s worth posting
    [warn] 12304#0: duplicate MIME type “text/html” in /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf:11

  2. A KeyError in /_dash-component-suites/dash_renderer/ that is an actual error
    [2019-03-07 00:57:24,301] ERROR in app: Exception on /_dash-component-suites/dash_renderer/ [GET]
    Traceback (most recent call last):
    File “/miniconda/lib/python3.6/site-packages/flask/”, line 2292, in wsgi_app
    response = self.full_dispatch_request()
    File “/miniconda/lib/python3.6/site-packages/flask/”, line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File “/miniconda/lib/python3.6/site-packages/flask/”, line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File “/miniconda/lib/python3.6/site-packages/flask/”, line 35, in reraise
    raise value
    File “/miniconda/lib/python3.6/site-packages/flask/”, line 1813, in full_dispatch_request
    rv = self.dispatch_request()
    File “/miniconda/lib/python3.6/site-packages/flask/”, line 1799, in dispatch_request
    return self.view_functionsrule.endpoint
    File “/miniconda/lib/python3.6/site-packages/dash/”, line 452, in serve_component_suites
    KeyError: ‘map’

My problem here is that this whole stack trace is in the back end so I don’t think it’s related to my code at all but rather the environment. Any thoughts? My Dockerfile has the following versions specified with the PIP installs and I’m running on Python 3.6:

RUN pip install dash==0.28.4
RUN pip install dash-html-components==0.13.2
RUN pip install dash-core-components==0.34.0
RUN pip install dash-table-experiments

It looks like your different dash package versions are out of sync. I think because you’ve pinned dash, dash-html-components, and dash-core-components but not dash-renderer, so it’s probably just getting the latest version of dash-renderer.

This is a problem that has now been fixed by forcing the synchronisation of compatible dash package versions. Not sure how you’re managing your requirements, but if you pip install -U dash. You will now get synchronised versions installed. As well as updated versions of all packages. Those versions you have pinned are quite old.

UPDATE: So I was able to get things working again. I tried @nedned 's approach as well as various other attempts to get the versions synced up. I ended up just installing the components without specifying a version.

However this created a new problem, I started getting Docker error 137s. Googling around led me to believe that this was a memory issue so I upped my instance type to something a little beefier and built the system again.

Thanks for the help @nedned! I had been avoiding any changes to those since that combination had worked in the past and I was sure it was something else that had changed.

1 Like