Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #6878

Closed
Open
Created Apr 26, 2014 by Administrator@rootOwner

Gitlab API returns 404 for various non obvious reasons

Created by: darklajid

Trying to create migration scripts from an existing gitorious installation.

After banging my head against the API for a while (actual issue: Valid JSON POSTed to api/v3/users returned 404, GETing that resource listed all users as expected) I stumbled upon a chain of issues:

https://github.com/gitlabhq/gitlabhq/issues/3526

closed in favor of..

https://github.com/gitlabhq/gitlabhq/issues/4209

which was closed due to no response from the poster. The magic information in that issue? The API actually returns 404 for random reasons, like 'password is not long enough', without any information in the logs or in the result.

The caller receives just {"message":"404 Not Found"} Using omnibus-gitlab's gitlab-ctl tail to look at all relevant logs, nothing hints at the root cause.

In addition, the information in the ticket 4209 is wrong/outdated it seems: My initial tests with a too short password ('foo' - hey, I'm testing and playing with scripts to migrate things. It's not that I plan to use that password, ever) caused me to fail, following the advice in 4209 to post at least 6 chars still failed ('foo123') with the same error, arbitrary retrying with 8 chars ('foo12345') works.

The API is awesome, but this really needs some love. The idea of a restful API should be that it's discoverable. I'd hope for:

  • better error messages, at least on the server, preferably for the client as well
  • a status code that makes sense. 404/not found doesn't/means something else.
Assignee
Assign to
Time tracking