RepositoryVersion.create() can't be called outside of a task
Docker push requires creating a repository version without dispatching a task. This is currently impossible because the RepositoryVersion.create() method always creates a CreatedResource. A CreatedResource requires a task_id to be saved to the database.
Have the RepositoryVersion.create() check if it's running inside a task. You can do that with Task.current .