Skip to content

gh run view with github enterprise does not work #3437

Description

@XC-

Describe the bug

Running gh run list works properly and lists the relevant runs. When attempting to look into run details with gh run view the command returns error failed to get jobs: HTTP 404: Not Found. In the URL there is stutter that does not look correct ../api/v3/api/v3/repos/... (unfortunately I cannot paste the full URL due to confidentiality reasons).

Github CLI version: 1.9.1
Github Enterprice Server version: 3.0

Steps to reproduce the behavior

  1. Complete login to the enterprise server with Github CLI
  2. Go to a repository directory that uses that server as a remote
  3. Run gh run list (This should work)
  4. Pick one of the run numbers and run gh run view <number>

Expected vs actual behavior

The client should show the details of the run, but instead fails with HTTP 404

Logs

Activity

  1. added
    bugSomething isn't working
    on Apr 16, 2021
  2. mislav commented on Apr 16, 2021

    @mislav
    Contributor

    Thank you for reporting! I'm having trouble reproducing this.

    Is it this URL that is failing?

    https://HOST/api/v3/repos/OWNER/REPO/actions/jobs/JOBID
    

    If so, when you called gh run view <number>, have you also specified the --job flag? I'm trying to figure out how was it fetching a job instead of a run in the first place, and why is it generating a wrong URL on your end and not on my end.

  3. vilmibm commented on Apr 16, 2021

    @vilmibm
    Contributor

    The failed to get jobs error is from the lack of --job (it's related to fetching all the jobs for a given run).

    The URL for that comes directly from the runs API and then we grab the path out and add it to the repo's host:

    	parsed, err := url.Parse(run.JobsURL)
    	if err != nil {
    		return nil, err
    	}
    
    	err = client.REST(repo.RepoHost(), "GET", parsed.Path[1:], nil, &result)
    	if err != nil {
    		return nil, err
    	}

    to get the reported malforming it would need to be coming from either the runs API or from the return of RepoHost() as far as I can read...which I have no explanation for.

  4. XC- commented on Apr 16, 2021

    @XC-
    Author

    @mislav If I remember correctly, yes. Except it has api/v3 twice. And no, I did not have --job flag, I did not use it in either of them.

  5. added
    priority-1Affects a large population and inhibits work
    and removed
    more-info-neededMore info needed from user/contributor
    on Apr 19, 2021
  6. mpeeps27 commented on Apr 20, 2021

    @mpeeps27
  7. mpeeps27 commented on Apr 20, 2021

    @mpeeps27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-1Affects a large population and inhibits work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions