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

GitHub and GitLab Configuration Failure #200

Closed
mydiemho opened this issue Jul 25, 2020 · 13 comments · Fixed by #201
Closed

GitHub and GitLab Configuration Failure #200

mydiemho opened this issue Jul 25, 2020 · 13 comments · Fixed by #201
Labels
Type: Bug 😢 A confirmed bug or something that isn't working as expected

Comments

@mydiemho
Copy link

After configure JHipster to access my GitHub account, I keep seeing the error JHipster has failed to reach your Github repositories.. When I checked on GitHub, I can see that JHipster is in the Authorized OAuth Apps list.

Screen Shot 2020-07-24 at 17 01 28

Screen Shot 2020-07-24 at 17 01 50

@SudharakaP SudharakaP added the Type: Bug 😢 A confirmed bug or something that isn't working as expected label Jul 25, 2020
@SudharakaP
Copy link
Member

SudharakaP commented Jul 25, 2020

@mydiemho : Thanks for reporting this. I was able to reproduce this. Although the JHipster app is authorized properly it shows this error it seems. Will take a look. 🤔

@SudharakaP SudharakaP changed the title GitHub configuration failure GitHub and GitLab Configuration Failure Jul 25, 2020
@SudharakaP
Copy link
Member

Just for the information; as pointed out in this comment; #93 (comment), this also applies to GitLab.

@vishal423
Copy link
Contributor

@SudharakaP, what error do you see in server logs?

@SudharakaP
Copy link
Member

SudharakaP commented Jul 25, 2020

@vishal423 : The error is,

Server Log
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [{"error":"Not Found"}] 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:113) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:170) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:112) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:782) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:740) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:449) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at io.github.jhipster.online.web.rest.GitResource.saveToken(GitResource.java:126) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at io.github.jhipster.online.web.rest.GitResource$$FastClassBySpringCGLIB$$ca87e103.invoke(<generated>) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) 
A 2020-07-25T05:57:49Z Jul 25 05:57:49 jhipster-app jhonline.war[11687]: #011at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) 

Seems like something to do with CORS. 🤔

@vishal423
Copy link
Contributor

I did a quick check on local setup, and able to configure GitHub without any issues or additional configurations. Have you tried on local setup to reproduce the issue?

@SudharakaP
Copy link
Member

SudharakaP commented Jul 25, 2020

I did a quick check on local setup, and able to configure GitHub without any issues or additional configurations. Have you tried on local setup to reproduce the issue?

@vishal423 : That's strange. I created my own OAuth App and OAuth Token and tested it on local and I could recreate this exact scenario. Even the error is the same. 😉 🤔 🤔

@vishal423
Copy link
Contributor

image

@SudharakaP
Copy link
Member

@vishal423 : Hmm.... 🤔 🤔 Kinda confusing why this happens on some machines,

Screenshot from 2020-07-25 12-40-37

@SudharakaP
Copy link
Member

SudharakaP commented Jul 25, 2020

@vishal423 : can you try running the prod profile and see if it works? 🤔

Because I have a feeling that since dev profile has all CORS enabled that might be why it's working. I'll try the dev profile as well in a minute; need to take a break. 😄

@SudharakaP
Copy link
Member

@vishal423 : For me it fails for dev as well. 😞

SudharakaP added a commit that referenced this issue Jul 26, 2020
This updates the project to Java 11 and fixes the problematic Git sync issues using the newer HttpClient libraries.

Fixes #200
SudharakaP added a commit that referenced this issue Jul 26, 2020
This updates the project to Java 11 and fixes the problematic Git sync issues using the newer HttpClient libraries.

Fixes #200
SudharakaP added a commit that referenced this issue Jul 26, 2020
This updates the project to Java 11 and fixes the problematic Git sync issues using the newer HttpClient libraries.

Fixes #200
@SudharakaP
Copy link
Member

It seems to me that this intermittent issue of Git Sync on both GitHub and GitLab comes from way we send the POST request to the Git provider using the RestTemplate library. I cannot pinpoint why it fails only for some people but I felt that its something to do with the library itself so I changed it to the more recent HttpClient of Java 11. And thus the project was also upgraded to Java 11. Please take a look and let me know if you see any issues; I tested this on my side several times to make sure and seems everything works fine, but given that it wasn't working for some people I would appreciate if you can test it on your end as well if the sync is working as expected. 😄

cc: @vishal423

@SudharakaP SudharakaP added the Status: Review Needed 🙏 Waiting for someone to review label Jul 26, 2020
SudharakaP added a commit that referenced this issue Jul 26, 2020
This updates the project to Java 11 and fixes the problematic Git sync issues using the newer HttpClient libraries.

Fixes #200
@SudharakaP SudharakaP removed the Status: Review Needed 🙏 Waiting for someone to review label Jul 26, 2020
SudharakaP added a commit that referenced this issue Jul 27, 2020
This updates the project to Java 11 and fixes the problematic Git sync issues using the newer HttpClient libraries.

Fixes #200
@SudharakaP
Copy link
Member

@mydiemho : I just released v2.6.4 which includes the fix for this. If you even encounter this issue again please feel free to let us know. 😄

cc: @tonsV2

Thanks both of you for reporting this issue. 😄

@devysf
Copy link
Contributor

devysf commented Sep 8, 2023

Hi, I am encountering this problem.
image

Additionally, although I receive access tokens on GitHub, I cannot list or select repositories.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 😢 A confirmed bug or something that isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants