mislav/hub · error
\nAre you sure that exists?
Error message
%s\nAre you sure that %s exists?
What it means
CreatePullRequest POSTs to `repos/<owner>/<repo>/pulls`. When the response status is 404, the original 'creating pull request' error is augmented with 'Are you sure that <projectURL> exists?' because GitHub returns 404 (not 403) for repositories the token cannot see or that don't exist. This is the library's hint that the repo slug is wrong or inaccessible.
Solutions
- Verify the repo slug exists: `gh repo view <owner>/<name>` or open projectURL in a browser while logged in.
- Check token access: ensure your token has repo scope and you are a collaborator if the repo is private.
- If the repo was moved, update the remote/project owner/name to the new slug.
- Confirm you're pushing/PRing against the right host (enterprise vs github.com) so the API base URL matches.
Example fix
// before
client.CreatePullRequest(project, params) // 404: repo inaccessible
// after
// verify first
if _, _, err := api.Repositories.Get(ctx, project.Owner, project.Name); err != nil {
return fmt.Errorf("repo %s/%s not found or inaccessible: %w", project.Owner, project.Name, err)
}
return client.CreatePullRequest(project, params) Defensive patterns
Strategy: validation
Validate before calling
resp, err := http.Get("https://api.github.com/repos/" + owner + "/" + name)
if err != nil || resp.StatusCode == 404 {
return fmt.Errorf("repo %s/%s does not exist or token lacks access", owner, name)
} Try / catch
pr, err := client.CreatePullRequest(project, params)
if err != nil && strings.Contains(err.Error(), "Are you sure that") {
return fmt.Errorf("check %s: repo missing, renamed, or token lacks access", project.WebURL("","",""))
} Prevention
- Verify the owner/repo slug exists before creating PRs (GET /repos/{owner}/{repo}).
- Ensure the token has repo scope and access to private repos.
- After repo renames/transfers, update remotes and project config.
- Use `gh repo view <owner>/<name>` as a preflight check.
When it happens
Trigger: POST to repos/{owner}/{name}/pulls returns HTTP 404: the repository does not exist, the owner/name are misspelled, or the authenticated token has no access to a private repo (GitHub hides private repos as 404).
Common situations: Typo'd owner or repo name in the project config; opening a PR against a fork whose upstream slug was renamed/moved; token lacking access to an org's private repo; repo was deleted or transferred.
Related errors
- Error: that fork is not available anymore
- Aborted: commits are not yet pushed to (use `-f` to force…
- Aborted: head branch is the same as base
- Aborted: no commits detected between
- Aborted: the current branch seems not yet pushed to a…
AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01).
Data as JSON: /api/errors/a3d9bc9c4497b084.
Report an issue: GitHub.
Appendix: source
Thrown at github/client.go:138
res, err := api.GetFile(fmt.Sprintf("repos/%s/%s/pulls/%s", project.Owner, project.Name, id), patchMediaType)
if err = checkStatus(200, "getting pull request patch", res, err); err != nil {
return
}
return res.Body, nil
}
func (client *Client) CreatePullRequest(project *Project, params map[string]interface{}) (pr *PullRequest, err error) {
api, err := client.simpleAPI()
if err != nil {
return
}
res, err := api.PostJSONPreview(fmt.Sprintf("repos/%s/%s/pulls", project.Owner, project.Name), params, draftsType)
if err = checkStatus(201, "creating pull request", res, err); err != nil {
if res != nil && res.StatusCode == 404 {
projectURL := strings.SplitN(project.WebURL("", "", ""), "://", 2)[1]
err = fmt.Errorf("%s\nAre you sure that %s exists?", err, projectURL)
}
return
}
pr = &PullRequest{}
err = res.Unmarshal(pr)
return
}
type PullRequestMergeResponse struct {
SHA string
Merged bool
Message string
}
func (client *Client) MergePullRequest(project *Project, prNumber int, params map[string]interface{}) (mr PullRequestMergeResponse, err error) {
api, err := client.simpleAPI()View on GitHub (pinned to 5c547ed804)