Just setting up drone, and I’m running into an issue after connecting it to our BitBucket Server (self hosted). I currently can use the same drone server, but give it settings for my github account and it all works fine. When I swap out the settings with the STASH settings for bitbucket server, I can load the git repos, but I have issues when I push into that repo. I can take the same repo, (including .drone.yml) and push to github and have it all work as expected
the panic aside, the error message is indicating that drone cannot find a .drone.yml file in your repository. Does such a file exist in ref=refs/heads/master repo=MY/repo?
update, I quickly dug into the lines of code in the stacktrace and here is what I can see:
an error is being returned when trying to get your .drone.yml from the stash server. The request is returning an http code > 299
drone expects an http error code > 299 to return a valid error message in json format based on the Stash schema [1]
it appears the error response is an empty array of errors, which drone does not expect (this is where the panic occurs) [2]
So I think there are two things here:
I need to fix the panic
Stash is still returning an error and is not returning any error message
Note that fixing the panic will not solve the overall issue. The panic is the symptom of the larger root cause which is a malformed error from Stash when requesting the .drone.yml file. I recommend checking your Stash server logs to see if it can provide any more useful details as to why it is erroring.
could it be because the bitbucket server is at a subURL? ie: hostname/bitbucket ?
I doubt it, only because if this were the case it would have impacted other API operations such as your ability to login, get your repository list, create the webhook, etc. Those operations have to succeed to get to the point that Drone receives a webhook.
I recommend checking the Bitbucket Server logs as a next step, since it could surface some useful information regarding why it is returning an error when using the API to get the .drone.yml.
I will also try to add some extra logging to the next release candidate so that we can capture the payload that is being returned by Bitbucket Server. But in the meantime, let me know what you find in the server logs.
Server Logs look normal far as I can tell on the bitbucket server side. Webhook is reporting a 500 Server error on posting to drone.
I see in the access logs for bitbucket numerous successful (HTTP 200) accesses by browsers to the .drone.yml file in the repo, However, I don’t see anything for a go lang http client? I would think that means it’s not getting around to requesting the .drone.yml file?
Great find, that certainly could be the issue. I just patched the code. The updated package will be included in our next release candidate (Monday/Tuesday).