Skip to content

Domain deletion task is failing #4789

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

Closed
humitos opened this issue Oct 22, 2018 · 3 comments
Closed

Domain deletion task is failing #4789

humitos opened this issue Oct 22, 2018 · 3 comments
Labels
Accepted Accepted issue on our roadmap Bug A bug
Milestone

Comments

@humitos
Copy link
Member

humitos commented Oct 22, 2018

This method,

https://github.com/rtfd/readthedocs.org/blob/df85fefc5f59c7a00bcc1ffe23965efe75e8c895/readthedocs/projects/models.py#L1030-L1034

deletes the Domain from the database and trigger a task called: symlink_domain. This task tries to get the Domain object using the pk from the database and it fails because the object was already removed.

I do see two different approaches here:

  1. do not trigger this task and rely on the task to remove orphan symlinks implemented in Task to remove orphan symlinks #3543
  2. refactor the task and the helper methods (Symlink.symlink_cnames and Symlink.remove_symlink_cname) to depend only in the Domain.domain string instead of the whole Domain object

Currently, we are depending on 1) but many errors are being generated in our sentry when the Domain is deleted: https://sentry.io/read-the-docs/readthedocs-org/issues/235601094/

I saw this code before, but I didn't noticed that the Domain object was deleted and then tried to get it from the DB inside the task: #3493 (comment)

@humitos humitos added the Bug A bug label Oct 22, 2018
@dojutsu-user
Copy link
Member

@humitos
I would like to work on this issue.
From my understanding,
Domain.domain should be passed instead of Domain.pk in the delete method like this

def delete(self, *args, **kwargs):  # pylint: disable=arguments-differ
        from readthedocs.projects import tasks
        broadcast(type='app', task=tasks.symlink_domain,
                  args=[self.project.pk, self.domain, True],)
        super(Domain, self).delete(*args, **kwargs)

and then correcting the task and other helper methods.

@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@humitos humitos added Accepted Accepted issue on our roadmap and removed Status: stale Issue will be considered inactive soon labels Jan 10, 2019
@humitos
Copy link
Member Author

humitos commented Jan 10, 2019

Not stale, we have a PR that deals with this issue.

@agjohnson agjohnson added this to the 2.9 milestone Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Bug A bug
Projects
None yet
Development

No branches or pull requests

3 participants