Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLab - 406 Not Acceptable download archive error #97

Closed
tebaly opened this issue May 5, 2023 · 6 comments
Closed

GitLab - 406 Not Acceptable download archive error #97

tebaly opened this issue May 5, 2023 · 6 comments

Comments

@tebaly
Copy link

tebaly commented May 5, 2023

Environment

Whith own registry, not working

Reproduction

Whith own registry, not working

Describe the bug

Whith own registry, not working

Additional context

No response

Logs

No response

@professorhaseeb
Copy link

# .env file content
GIGET_AUTH="TOKEN"

Gitlab Personal Access token is used, with proper scope(downloads properly using other HTTP clients)

output for: npm run dev

Nuxi 3.5.3                                                                                                                                                                                                               8:26:57 pm
Nuxt 3.5.3 with Nitro 2.4.1

ERROR  Failed to download https://gitlab.com/GROUP/REPO/-/archive/master.tar.gz: 406 Not Acceptable 

at download (/node_modules/giget/dist/shared/giget.093c29e5.mjs:29:11)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async downloadTemplate (/node_modules/giget/dist/shared/giget.093c29e5.mjs:244:5)
  at async resolveConfig (/node_modules/c12/dist/index.mjs:250:20)
  at async extendConfig (/node_modules/c12/dist/index.mjs:217:21)
  at async loadConfig (/node_modules/c12/dist/index.mjs:159:5)
  at async loadNuxtConfig (/node_modules/@nuxt/kit/dist/index.mjs:2447:18)
  at async Object.invoke (/node_modules/nuxi/dist/chunks/dev.mjs:124:20)
  at async _main (/node_modules/nuxi/dist/cli.mjs:48:20)

mentioned repo is private, in a group.

@zola33dsf
Copy link

Hey, I have the same problem, did you find any solutions ? @professorhaseeb

@NiMalkin
Copy link

Description

Good evening, guys! I have the same problem and I tried all possible solutions to the problem. This doesn't work.

At the same time, everything works fine via curl and postman. Even the docker authorizes successfully, but the giget (and any node.js apps) cannot execute this request. I also got headers and cookies from successful requests - that doesn't work either.

It seems to me that these may be features of the Gitlab settings. Do you have any ideas @tebaly @professorhaseeb @zola33dsf? I would be very grateful for your advice.

Error with CI/CD

ERROR  Failed to download https://gitlab.DOMAIN.com/GROUP/REPO/-/archive/develop.tar.gz: 406 Not Acceptable
  at download (node_modules/.pnpm/giget@1.1.3/node_modules/giget/dist/index.mjs:30:11)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async downloadTemplate (node_modules/.pnpm/giget@1.1.3/node_modules/giget/dist/index.mjs:252:5)
  at async resolveConfig (node_modules/.pnpm/c12@1.4.2/node_modules/c12/dist/index.mjs:250:20)
  at async extendConfig (node_modules/.pnpm/c12@1.4.2/node_modules/c12/dist/index.mjs:217:21)
  at async loadConfig (node_modules/.pnpm/c12@1.4.2/node_modules/c12/dist/index.mjs:159:5)
  at async loadNuxtConfig (node_modules/.pnpm/@nuxt+kit@3.6.5/node_modules/@nuxt/kit/dist/index.mjs:2483:18)

Success with CURL

curl --header "Authorization: Bearer TOKEN" "https://gitlab.DOMAIN.com/GROUP/REPO/-/archive/develop.tar.gz" --output ./REPO.tar.gz
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                               Dload  Upload   Total   Spent    Left  Speed
100 1481k  100 1481k    0     0   476k      0  0:00:03  0:00:03 --:--:--  476k

P.S. By the way, if you have problems with CORS - nitro proxy works great.

@andreymart-test
Copy link
Contributor

andreymart-test commented Nov 23, 2023

I have the same problem, with gitlab. Personal public repository.

  at async loadNuxtConfig (/C:/casino/manager/node_modules/.pnpm/@nuxt+kit@3.8.2_rollup@3.29.4/node_modules/@nuxt/kit/dist/index.mjs:2530:18)
  at async Object.run (/C:/casino/manager/node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/chunks/dev.mjs:172:25)
  at async runCommand$1 (/C:/casino/manager/node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1648:16)
  at async runCommand$1 (/C:/casino/manager/node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1639:11)
  at async runMain$1 (/C:/casino/manager/node_modules/.pnpm/nuxi@3.10.0/node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1773:7)

 ERROR  Failed to download https://gitlab.com/myUserName/myRepo/-/archive/master.tar.gz: 406 Not Acceptable     

P.S github repositories work without error under identical conditions

  • giget: 1.1.3
  • windows 11
  • nuxt 3.8.2

Maybe giget is not sending an additional header on request in the case of gitlab - https://stackoverflow.com/questions/14251851/what-is-406-not-acceptable-response-in-http

@andreymart-test
Copy link
Contributor

After a deep and long research, I found these hotlinking rules on gitlab.
https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2
The solution for me was to add to the giget library in the fetch mode: 'same-origin' function.
I created a PR to fix this error #123

In my fork giget downloading archive from gitlab works without errors.

@pi0
Copy link
Member

pi0 commented Dec 24, 2023

The issue should be fixed with workaround in #123 in latest version. (thanks @andreymart-test ❤️ )

@pi0 pi0 closed this as completed Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants