Error: "Waiting for deployment status updates..." & timeout

We are using a customized version of Drone v0.4. We activate numerous GitHub repositories in Drone via the API, using the same user token (retrieved from Drone profile screen). After some time, maybe a year, the Drone webhooks on many of the repositories begin failing with 404 errors. The Drone builds do not occur and upon checking the Drone logs, we found the following error (sensitive info replaced with brackets <>).

    time="<time>" level=error msg="failure to get .drone.yml for <org>/<repo>. GET <github url>/contents/.drone.yml?ref=<ref #>: 401 Bad credentials []"

Error #01: GET /contents/.drone.yml?ref=: 401 Bad credentials []

The issue also occurs when attempting to activate new repositories in Drone (via API) using the same Drone user token. The Drone database token expiration column contains ‘0’, seemingly indicating that the token does not expire.

We have found a work around by deactivating the repository from Drone and reactivating using a different Drone user token, but this results in loss of build history. To prevent the issue from occurring during new repo creation, update encryption_token in relevant .yml

Possibly related:

Checking stack overflow:

A couple of things here.

  1. Drone 0.4 is no longer supported. Development for it stopped Apr 28, 2016. Please upgrade to Drone 0.8.*.

  2. The links you provided are for the newer versions of Drone, experiencing the same root issue.

  3. The root cause of what you are seeing is because a repository was “enabled” or “activated” by a user who now no longer has access to that repository (probably they left an org or was removed from a team or repository contributor).

  4. To fix this in 0.4, you need to update the owner of the repo in drone’s database to be one who has access to that repository.

  5. I recommend upgrading to the latest drone installation while the database migration is still capable.

Thank you for your reply. I guess the first order of business is updating drone. For #3 we are using a dedicated account to manage the operations.