Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 not found error for private repos #1

Closed
pelmered opened this issue Feb 11, 2022 · 6 comments
Closed

404 not found error for private repos #1

pelmered opened this issue Feb 11, 2022 · 6 comments

Comments

@pelmered
Copy link
Contributor

I have logged in and approved Actions Watcher to watch action runs, but when I run the command I get 404.

I get the same error on both projects in my organisation and directly on my profile, and both on public and private repos.
I also tried specifying the repo URL with --repo=, but that gives me the same error.

Is there some kind of error with the API authentication maybe?

Package version: 0.12.0
PHP version: 8.1.2
Composer: 2.2.5

Let me know if you need anything else to debug this.

Command output:

actions-watcher -v


      GitHub Actions Watcher by Spatie                                                   Logged in as pelmered



    Fetching GitHub workflow runs...

In FailedGitHubResponse.php line 15:

  [App\Exceptions\FailedGitHubResponse]
  GitHub didn't response successfully. Response:  HTTP request returned status code 404:
  {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/actions#list-workflow-runs-fo
  r-a-repo (truncated...)


Exception trace:
  at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Exceptions/FailedGitHubResponse.php:15
 App\Exceptions\FailedGitHubResponse::make() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Support/GitHub/GitHub.php:71
 App\Support\GitHub\GitHub->ensureSuccessfulRequest() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Support/GitHub/GitHub.php:37
 App\Support\GitHub\GitHub->getWorkflowRuns() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Support/GitHub/GitHub.php:55
 App\Support\GitHub\GitHub->getLatestWorkflowRuns() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Commands/WatchCommand.php:84
 App\Commands\WatchCommand->displayWorkflows() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Commands/WatchCommand.php:30
 App\Commands\WatchCommand->handle() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/BoundMethod.php:36
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/Util.php:41
 Illuminate\Container\Util::unwrapIfClosure() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/BoundMethod.php:93
 Illuminate\Container\BoundMethod::callBoundMethod() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/BoundMethod.php:37
 Illuminate\Container\BoundMethod::call() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/Container.php:653
 Illuminate\Container\Container->call() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/console/Command.php:136
 Illuminate\Console\Command->execute() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Command/Command.php:291
 Symfony\Component\Console\Command\Command->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/console/Command.php:121
 Illuminate\Console\Command->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Application.php:989
 Symfony\Component\Console\Application->doRunCommand() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/console/Application.php:102
 Illuminate\Console\Application->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Console/Kernel.php:129
 Illuminate\Foundation\Console\Kernel->handle() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/laravel-zero/framework/src/Kernel.php:95
 LaravelZero\Framework\Kernel->handle() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/actions-watcher:35
 require() at /Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher:14
 include() at /Users/peter/.composer/vendor/bin/actions-watcher:117

In Response.php line 288:

  [Illuminate\Http\Client\RequestException (404)]
  HTTP request returned status code 404:
  {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/actions#list-workflow-runs-fo
  r-a-repo (truncated...)


Exception trace:
  at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/http/Client/Response.php:288
 Illuminate\Http\Client\Response->toException() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Exceptions/FailedGitHubResponse.php:13
 App\Exceptions\FailedGitHubResponse::make() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Support/GitHub/GitHub.php:71
 App\Support\GitHub\GitHub->ensureSuccessfulRequest() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Support/GitHub/GitHub.php:37
 App\Support\GitHub\GitHub->getWorkflowRuns() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Support/GitHub/GitHub.php:55
 App\Support\GitHub\GitHub->getLatestWorkflowRuns() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Commands/WatchCommand.php:84
 App\Commands\WatchCommand->displayWorkflows() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/app/Commands/WatchCommand.php:30
 App\Commands\WatchCommand->handle() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/BoundMethod.php:36
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/Util.php:41
 Illuminate\Container\Util::unwrapIfClosure() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/BoundMethod.php:93
 Illuminate\Container\BoundMethod::callBoundMethod() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/BoundMethod.php:37
 Illuminate\Container\BoundMethod::call() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/container/Container.php:653
 Illuminate\Container\Container->call() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/console/Command.php:136
 Illuminate\Console\Command->execute() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Command/Command.php:291
 Symfony\Component\Console\Command\Command->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/console/Command.php:121
 Illuminate\Console\Command->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Application.php:989
 Symfony\Component\Console\Application->doRunCommand() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/illuminate/console/Application.php:102
 Illuminate\Console\Application->run() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Console/Kernel.php:129
 Illuminate\Foundation\Console\Kernel->handle() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/vendor/laravel-zero/framework/src/Kernel.php:95
 LaravelZero\Framework\Kernel->handle() at phar:///Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher/actions-watcher:35
 require() at /Users/peter/.composer/vendor/spatie/github-actions-watcher/builds/actions-watcher:14
 include() at /Users/peter/.composer/vendor/bin/actions-watcher:117
@freekmurze
Copy link
Member

That's strange, it works for all my repos (and I haven't hardcoded "spatie" somewhere 🙂)

@pelmered
Copy link
Contributor Author

I can try digging a little deeper in the code. I get back with what I can find.

@freekmurze
Copy link
Member

Thanks!

@pelmered
Copy link
Contributor Author

pelmered commented Feb 12, 2022

Update: It works for public repos. I had .git in the end of the repo name when testing before.

However, it doesn't seem to work with private repos. I seems to be something wring this the Authorization header, but that looks fine to me when I inspected the request.
I tried with the same URL and token in Postman and that worked fine.

@pelmered pelmered changed the title 404 not found error 404 not found error for private repos Feb 12, 2022
@freekmurze
Copy link
Member

Looking at the code I would also think that the tool should work with private repos. Feel free to send a PR that fixes working with private repos for you.

@freekmurze
Copy link
Member

This has been fixed in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants