Skip to content

Subpath in self-hosted gitlab is not used

Summary

When self-hosted gitlab is in a subpath (such as https://my.domain/gitlab/) all results return "Project failed to load" with a 404 error.

Initially discussed in #297 (closed) but you asked me to open as its own ticket.

Steps to reproduce

  • Install self-hosted gitlab in a subpath like https://my.domain/gitlab/
  • Configure gitlab.instanceUrl to be https://my.domain/gitlab/
  • Set PAT
  • Open the Gitlab Workflow tab

What is the current bug behavior?

  • "Issues and merge requests" shows "Project failed to load"
  • "For Current Branch" shows "Error occurred, please try to refresh"
  • Error 404 logged in console
  • Looking in fiddler, see a request being made to https://my.domain/api/graphql

What is the expected correct behavior?

Relevant logs and/or screenshots

output of git remote show origin:

* remote origin
  Fetch URL: https://my.domain/gitlab/myname/keyboard.git
  Push  URL: https://my.domain/gitlab/myname/keyboard.git
  HEAD branch: master
  Remote branch:
    master tracked

Configuration file:

{
    "gitlab.instanceUrl": "https://my.domain/gitlab/",
}

In the log:

GraphQL Error (Code: 404): {"response":{"error":"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n","status":404},"request":{"query":"\n  query GetProject($projectPath: ID!) {\n    project(fullPath: $projectPath) {\n      id\n      name\n      fullPath\n      webUrl\n      group {\n        id\n      }\n    }\n  }\n","variables":{"projectPath":"myname/keyboard"}}}
Error: GraphQL Error (Code: 404): {"response":{"error":"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n","status":404},"request":{"query":"\n  query GetProject($projectPath: ID!) {\n    project(fullPath: $projectPath) {\n      id\n      name\n      fullPath\n      webUrl\n      group {\n        id\n      }\n    }\n  }\n","variables":{"projectPath":"myname/keyboard"}}}
	at GraphQLClient.<anonymous> (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:172:35)
	at step (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:63:23)
	at Object.next (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:44:53)
	at fulfilled (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:35:58)
	at processTicksAndRejections (internal/process/task_queues.js:97:5)
{
  "message": "API request failed when trying to get current project because: GraphQL Error (Code: 404): {\"response\":{\"error\":\"<html>\\r\\n<head><title>404 Not Found</title></head>\\r\\n<body>\\r\\n<center><h1>404 Not Found</h1></center>\\r\\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\\r\\n</body>\\r\\n</html>\\r\\n\",\"status\":404},\"request\":{\"query\":\"\\n  query GetProject($projectPath: ID!) {\\n    project(fullPath: $projectPath) {\\n      id\\n      name\\n      fullPath\\n      webUrl\\n      group {\\n        id\\n      }\\n    }\\n  }\\n\",\"variables\":{\"projectPath\":\"myname/keyboard\"}}}",
  "stack": [
    "Error: API request failed when trying to get current project because: GraphQL Error (Code: 404): {\"response\":{\"error\":\"<html>\\r\\n<head><title>404 Not Found</title></head>\\r\\n<body>\\r\\n<center><h1>404 Not Found</h1></center>\\r\\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\\r\\n</body>\\r\\n</html>\\r\\n\",\"status\":404},\"request\":{\"query\":\"\\n  query GetProject($projectPath: ID!) {\\n    project(fullPath: $projectPath) {\\n      id\\n      name\\n      fullPath\\n      webUrl\\n      group {\\n        id\\n      }\\n    }\\n  }\\n\",\"variables\":{\"projectPath\":\"myname/keyboard\"}}}",
    "\tat Object.<anonymous> (c:\\Users\\myname\\.vscode\\extensions\\gitlab.gitlab-workflow-3.12.0\\out\\src\\gitlab_service.js:91:19)",
    "\tat Generator.throw (<anonymous>)",
    "\tat rejected (c:\\Users\\myname\\.vscode\\extensions\\gitlab.gitlab-workflow-3.12.0\\out\\src\\gitlab_service.js:6:65)",
    "\tat processTicksAndRejections (internal/process/task_queues.js:97:5)"
  ]
}