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

throw exception when getting all issues for logged user : [NotFoundException: issues was not found.] #1461

Closed
Abdelkrim opened this issue Sep 8, 2016 · 4 comments

Comments

@Abdelkrim
Copy link

The challenge

  1. Using Octokit.OctokitNet
  2. the user is registered
  3. we get all issues for the current user using client.Issue.GetAllForCurrent();

Result:

  1. An exception is raised: Octokit.NotFoundException: issues was not found.

Note:

  1. my rate limit hasn't been exceed

QUESTION1: How to get all issues?

QUESTION2: Why does the exception refers to a file that is not on my HDD? C:\Users\shiftkey\Documents\GitHub\octokit.net\Octokit\Clients\ApiPagination.cs:36

The console log on IIS
`
Server Error in '/' Application.

issues was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Octokit.NotFoundException: issues was not found.

Source Error:

Line 36: // requires that the user be logged in to work.
Line 37: //IReadOnlyList issues = await client.Issue.GetAllForCurrent();
Line 38: var issues = await client.Issue.GetAllForCurrent();
Line 39: IReadOnlyList repositories = await client.Repository.GetAllForCurrent();
Line 40: User users = await client.User.Get("abdelkrim");

Source File: C:\GitHubStratEx\Controllers\HomeController.cs Line: 38

Stack Trace:
**[NotFoundException: issues was not found.]
Octokit.d__01.MoveNext() in C:\Users\shiftkey\Documents\GitHub\octokit.net\Octokit\Clients\ApiPagination.cs:36** System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 System.Runtime.CompilerServices.TaskAwaiter1.GetResult() +28
GitHubStratEx.Controllers.d__4.MoveNext() in C:\GitHubStratEx\Controllers\HomeController.cs:38
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +97
System.Web.Mvc.Async.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) +17
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +48
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
System.Web.Mvc.Async.AsyncInvocationWithFilters.b__3d() +50
System.Web.Mvc.Async.<>c__DisplayClass46.b__3f() +225
System.Web.Mvc.Async.<>c__DisplayClass33.b__32(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +48
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
System.Web.Mvc.Async.<>c__DisplayClass2b.b__1c() +26
System.Web.Mvc.Async.<>c__DisplayClass21.b__1e(IAsyncResult asyncResult) +100
System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +48
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
System.Web.Mvc.Controller.b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +48
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
System.Web.Mvc.Controller.b__15(IAsyncResult asyncResult, Controller controller) +12
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +22 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +48
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +48
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
`

@shiftkey
Copy link
Member

shiftkey commented Sep 9, 2016

QUESTION1: How to get all issues?

GetAllForCurrent() will return the issues created and assigned to the current user. My psychic debugger thinks you haven't specified any credentials on your GitHubClient - the 404 typically occurs when you're not authenticated for a certain resource.

Check out the Authenticated Access section in the documentation for how to set this.

QUESTION2: Why does the exception refers to a file that is not on my HDD? C:\Users\shiftkey\Documents\GitHub\octokit.net\Octokit\Clients\ApiPagination.cs:36

These paths are embedded into the PDB files at build time. If you'd like to step through the source, here's a guide to getting that working.

@Abdelkrim
Copy link
Author

Abdelkrim commented Sep 9, 2016

Dear @shiftkey , as you can see, the credentials are present.

I have used the 'token authentication' mechanism as you can see on the screenshot.

QUESTION1: The Login is equal to 'null', is it the expected behaviour?

QUESTION2: From that point, how could I get the login of the authenticated user?

INFO: here is the deployed app, note that my issues' list is empty; you might have a different result: https://githubstratex.azurewebsites.net

githubstratex-credentials are present

@shiftkey
Copy link
Member

@Abdelkrim aha!

This is a permissions issue with your OAuth app - your application is only setup to request user and notifications scope, but everything issues requires at least public_repo scope.

Once you enable that, you should receive an empty response instead of the 404 error.

@Abdelkrim
Copy link
Author

Dear @shiftkey this is correct, I can read the issues of the registered user now!

Many thanks!

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