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

projects: don't explode trying to update UpdateDocsTaskStep state #4485

Merged
merged 1 commit into from Aug 22, 2018

Conversation

Projects
None yet
3 participants
@xrmx
Contributor

xrmx commented Aug 7, 2018

If an exception is raised before run_setup has been called we try to update the setup_env that is not here.

Traceback (most recent call last):
  File "/readthedocs/projects/tasks.py", line 313, in run
    self.version = self.get_version(self.project, version_pk)
  File "/readthedocs/projects/tasks.py", line 84, in get_version
    version_data = api_v2.version(version_pk).get()
  File "/lib/python3.5/site-packages/slumber/__init__.py", line 155, in get
    resp = self._request("GET", params=kwargs)
  File "/lib/python3.5/site-packages/slumber/__init__.py", line 101, in _request
    raise exception_class("Client Error %s: %s" % (resp.status_code, url), response=resp, content=resp.content)
slumber.exceptions.HttpNotFoundError: Client Error 404: http://localhost:8002/api/v2/version/868/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/docsitalia/management/commands/rebuild_projects.py", line 33, in handle
    task.run(version.project.pk, version_pk=version.pk, build_pk=build.pk)
  File "/readthedocs/projects/tasks.py", line 332, in run
    build_id=build_pk,
AttributeError: 'UpdateDocsTaskStep' object has no attribute 'setup_env'
@humitos

Thanks!

I found this while working on another issue and wrote a comment in this PR: #3864

In that PR, I mentioned that this happens for the self.setup_env but also a couple of lines below with self.build_env. It may worth to add the same checking there also.

projects: don't explode trying to update UpdateDocsTaskStep state
If we don't have it because setup_env hasn't been called yet.

Traceback (most recent call last):
  File "/readthedocs/projects/tasks.py", line 313, in run
    self.version = self.get_version(self.project, version_pk)
  File "/readthedocs/projects/tasks.py", line 84, in get_version
    version_data = api_v2.version(version_pk).get()
  File "/lib/python3.5/site-packages/slumber/__init__.py", line 155, in get
    resp = self._request("GET", params=kwargs)
  File "/lib/python3.5/site-packages/slumber/__init__.py", line 101, in _request
    raise exception_class("Client Error %s: %s" % (resp.status_code, url), response=resp, content=resp.content)
slumber.exceptions.HttpNotFoundError: Client Error 404: http://localhost:8002/api/v2/version/868/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/docsitalia/management/commands/rebuild_projects.py", line 33, in handle
    task.run(version.project.pk, version_pk=version.pk, build_pk=build.pk)
  File "/readthedocs/projects/tasks.py", line 332, in run
    build_id=build_pk,
AttributeError: 'UpdateDocsTaskStep' object has no attribute 'setup_env'

While at it do the same for build_env that may be not set if run_build
fail early.
@xrmx

This comment has been minimized.

Show comment
Hide comment
@xrmx

xrmx Aug 7, 2018

Contributor

Update the PR to check also for build_env.

Contributor

xrmx commented Aug 7, 2018

Update the PR to check also for build_env.

@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Aug 22, 2018

Member

Looks good. I think we need to think through this more, but 👍 on having the short-term fix.

Member

ericholscher commented Aug 22, 2018

Looks good. I think we need to think through this more, but 👍 on having the short-term fix.

@ericholscher ericholscher merged commit ae26ef8 into rtfd:master Aug 22, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment