mislav/hub · error

%s\nAre you sure that %s 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.

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)

Solutions

  1. Verify the repo slug exists: `gh repo view <owner>/<name>` or open projectURL in a browser while logged in.
  2. Check token access: ensure your token has repo scope and you are a collaborator if the repo is private.
  3. If the repo was moved, update the remote/project owner/name to the new slug.
  4. 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

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


AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01). Data as JSON: /api/errors/a3d9bc9c4497b084. Report an issue: GitHub.