Github-release plugin fails with "artifact: POST [...] 404 Not Found"

Hi,

I have been through Facing issue in publishing artifacts to github releases but was unable to solve my issue.

I checked that my token is fine and was able to upload artifacts through gh release upload <my_tag> <my_artifact> but using the same token, upload fails with github-release plugin.

I am using below configuration (github being the secret name in the drone settings for the repository):

- name: publish artifacts
  image: plugins/github-release
  settings:
    api_key:
      from_secret: github
    files: build/*
    checksum:
      - sha512
    note: CHANGELOG.md

and while CHANGELOG.md is seen in the release note, artifacts upload fails with the following:

latest: Pulling from plugins/github-release
Digest: sha256:e6c8464739f1148ed7151fe660f6bc68124c8814572f3508f91080301a3dcff8
Status: Image is up to date for plugins/github-release:latest
Found release 260 for tag test_richard
DRAFT: false
Publishing a release draft
Successfully updated test_richard release
time="2022-12-21T15:19:57Z" level=error msg="execution failed: failed to upload the files: failed to upload build/akidanet_faceidentification_edge_iq8_wq4_aq4.fbz artifact: POST https://git.corp.brainchipinc.com/api/v3/upload/repos/brainchipSW/akida_demo/releases/260/assets?name=akidanet_faceidentification_edge_iq8_wq4_aq4.fbz: 404 Not Found []"

Is there a way to collect more logs to nail down the issue?

Thanks,
RC

Hi @rchevalier a few things I noticed.

Are you using github enterprise?

I noticed that the URL https://git.corp.brainchipinc.com returns a 404 - like the error suggests - is that URL correct?

In the docs here - Drone Plugins - Github Release - it suggests github enterprise requires a base url and upload url - neither seem to be in you drone yaml.

Hopefully one of these thoughts points you in the right direction :slight_smile:

Hi Dan!

you are correct, this is GHE.

Seeing https://git.corp.brainchipinc.com/api/v3/upload/repos/brainchipSW/akida_demo/releases/260 in the above log made me think that base_urlwas not needed (as so upload_url neither). I can actually list release content with gh api -H "Accept: application/vnd.github+json" --hostname git.corp.brainchipinc.com --method POST /repos/brainchipSW/akida_demo/releases/260

Shall I then use:

base_url: https://git.corp.brainchipinc.com/api/v3
upload_url: https://git.corp.brainchipinc.com/api/uploads

as suggested in GitHub release plugin configuration for github enterprise - #2 by flynneva - Drone or something different?

Thanks,
RC

Using the following:

- name: publish artifacts
  image: plugins/github-release
  settings:
    base_url: https://git.corp.brainchipinc.com/api/v3
    upload_url: https://git.corp.brainchipinc.com/api/uploads
    api_key:
      from_secret: github
    files: build/*
    checksum:
      - sha512
    note: CHANGELOG.md

It works :slight_smile: thx Dan!
Output for reference:

latest: Pulling from plugins/github-release
Digest: sha256:e6c8464739f1148ed7151fe660f6bc68124c8814572f3508f91080301a3dcff8
Status: Image is up to date for plugins/github-release:latest
Both base_url and upload_url are deprecated. Please remove them from your config!Found release 260 for tag test_richard
DRAFT: false
Publishing a release draft
Successfully updated test_richard release
Successfully uploaded build/akidanet_faceidentification_edge_iq8_wq4_aq4.fbz artifact
Successfully uploaded build/akidanet_imagenet_224_alpha_50_edge_iq8_wq4_aq4.fbz artifact
Successfully uploaded build/akidanet_vww_iq8_wq4_aq4.fbz artifact
Successfully uploaded build/yolo_akidanet_voc_iq8_wq4_aq4.fbz artifact
Successfully uploaded build/yolo_akidanet_widerface_iq8_wq4_aq4.fbz artifact
Successfully uploaded sha512sum.txt artifact

shall I worry about it?

hey @rchevalier glad that it worked :slight_smile:

it may be something that is going to be fully deprecated from the github API in future so a change probably should be made in the plugin - we are always opens to pull requests :wink:

1 Like