package repo: generic upload fails with URL-encoded path results in error "file is missing"

I followed these instructions:

https://docs.gitlab.com/ee/user/packages/generic_packages/index.html

I thought it would be easier to learn it on the command line first, but no matter I tried, I always get "file is missing"

curl --header "PRIVATE-TOKEN: $TOK" \
     --upload-file file.txt \
     https://gitlab.com/api/v4/projects/<MYTHING>%2F<MYTHING>/packages/generic/manualtest/0.0.1/file.txt

I tried wput, spent time digging in man curl, tried different files, but I always got that "file is missing" return. The only difference I could get is was by uploading a large binary file instead of text. Then I could get:

{"error":"file is missing"}

FINALLY I gave up and tried it via CI (which I assumed we be a PIA to debug: but no it just worked right away!)

pkgrepo:
  image: alpine
  needs: []
  script:
    - apk add curl
    - 'echo "hello" > file.txt'
    - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file file.txt ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/my_package/0.0.1/file.txt'

Is it possible for the API to give a more useful error message? Or would be possible to have another GET to retrieve a listing, something like:

GET /projects/:id/packages/generic/

That way one could at least tell if downloads are working (before one has any packages, you can't try to download one).

Or add a "debugging" section to the docs?

Edited by Tiffany Rea