-
Notifications
You must be signed in to change notification settings - Fork 162
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
LoginAsync waiting Infinitely #134
Comments
What version of gitlab are you using? |
Depending on how many projects you have it could take a while to return the result from |
Can you show me the code you written so far to get projects? If your not careful you could be running code against |
Gitlab version :12.9.2 |
Iam connecting to my Local self hosted instance which have 99 projects. |
If it's your own self hosted what sort of config do you have? And why are you not using a token if so? |
Iam connecting to my local server which have 99 projects. Also, issue is same if i call LoginAsync method. |
yesterday? did you upgrade your gitlab since? |
Now if I put http://my server/api/v4/projects in browser , it does return the JSON |
That doesn't really tell me anything useful @pmsudhi |
Nope. Gitlab was.updated 2 week ago I guess. Not able to make any guess what would have changed. That is the reason why created new test application just by calling LoginAsync. |
Did the token expire? Did the token get revoked? Are you handling when your oauth token expires? |
What authentication schema have you setup on your gitlab instance? LDAP? own user database? |
Not sure what to tell you, the integration test for login passes just fine even against the latest version of gitlab. Is this code run against netframework 4.8 or dotnet core 3? |
Actual code is .NET Standard 2.0 Class library and the test application is .net core 3.1 Windows Application |
Got Some additional Information. I ran Fiddler to trace the traffic and it appears, Gitlab does responded with data. Following is the details REQUEST
Response
|
So your application actually get's stuck on the lock and not the request itself? |
No. The Arrow is little misplaced in the snapshot. :) . It never hits the lock. the call |
Not sure why it would get stuck than as you can see for #135 it passes fine. |
Yeh. Had seen that case. In My system it is like this, |
I cannot replicate the issue. 🤷♂️ |
Manged to find the problem . remember the discussion here #131 (comment) After this, I had removed Task.Run from my code . Since my calls are from non async methods , the direct call to LoginAsync was /may resulting in a deadlock. When I call Task.Run, the task created may be in the current context(just like we face problem when accessing GUI from threads). So when I called,
but when I called it worked. |
Change your code to call from an async method so you can enjoy async/await code. |
I Wish i could. Unfortunately not all use cases can have that luxury. :( Any ways thanks for the support.closing this issue now. |
When I make a call to
client.LoginAsync
, the method never returns. The call inin GitlabHttpFacade never returns.
Either my self hosted gitlab server blocked the API calls or some thing related to network happened , because my Client application using GitLabAPIClient was working fine until yesterday. Do you have any probable scenarios that may trigger this issue. In either case, the wait should do a timeout . Implemented Cancelation Token in POST request like below,
it works, but not fits to the existing code flow. Since I am very new to this API, just getting used to the workflow. The timeout value can be set at GitlabClient level, but putting this cancellation token in all request, must be there a better way to do this.
But the Big question, Why the Gitlab not returning the request? tried both Private key method and then calling client.Project.getAsync() , and issue is same. Iam able to access the Gitlab through browser, restarted my gitlab instance, but still same issue.
Also, When i make a URL request in browser, it returns Jsons
http://myserver/api/v4/projects
The text was updated successfully, but these errors were encountered: