PTCInc / thingworx-gitbackup-extension

[Unofficial/Not supported] ThingWorx GitBackup Extension for storing your ThingWorx application code in a Git repository
MIT License
25 stars 11 forks source link

Cannot Pull, Push with my bitbucket company #43

Closed vxba closed 1 year ago

vxba commented 1 year ago

I'm using Other options for git servertype during my company using bitbucket enterprise and I have an issue with pull, and push to bitbucket. the detailed logs as below.

Any workaround solution to resolve this issue?

Pull log:

Pull Error: org.eclipse.jgit.api.errors.TransportException: https://bitbucket.mycompany.com/scm/test/test_thingworx_git.git: cannot open git-upload-pack at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:222) at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:263) at gb.GitBackupTemplate.Pull(GitBackupTemplate.java:284) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.thingworx.common.processors.ReflectionProcessor.processService(ReflectionProcessor.java:230) at com.thingworx.handlers.ReflectionServiceHandler.processService(ReflectionServiceHandler.java:50) at com.thingworx.handlers.ServiceHandlerBase.processServiceWithMetrics(ServiceHandlerBase.java:48) at com.thingworx.things.Thing.processServiceRequestDirect(Thing.java:7929) at com.thingworx.things.Thing.processAPIServiceRequest(Thing.java:7866) at com.thingworx.webservices.BaseService.handleInvoke(BaseService.java:3255) at com.thingworx.webservices.BaseService.service(BaseService.java:479) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at com.thingworx.security.authentication.sso.SSOSecurityContextFilter.doFilter(SSOSecurityContextFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at com.thingworx.security.contenttype.

Push log: "Push Error: org.eclipse.jgit.api.errors.TransportException: Nothing to push.\n\tat org.eclipse.jgit.api.PushCommand.call(PushCommand.java:147)\n\t at gb.GitBackupTemplate.Push(GitBackupTemplate.java:243)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\t at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\t at java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.thingworx.common.processors.ReflectionProcessor.processService(ReflectionProcessor.java:230)\n\t at com.thingworx.handlers.ReflectionServiceHandler.processService(ReflectionServiceHandler.java:50)\n\t at com.thingworx.handlers.ServiceHandlerBase.processServiceWithMetrics(ServiceHandlerBase.java:48)\n\t at com.thingworx.things.Thing.processServiceRequestDirect(Thing.java:7929)\n\t .....

vrosu commented 1 year ago

Hi,

  1. does your bitbucket server accept user and password/token authentication? If it's using tokens, have you created a token with rights for pull/push?
  2. I suspect (but not very sure) that the cause of the error at pull is caused by something we do not see in your error message. Can you check and see which is the last "Caused by:" in the bigger stacktrace? That is the root cause of the issue.
vxba commented 1 year ago

does GitBackup Extension support token authentication? I can check out bitbucket repo by user/password using git command as normal also I try to set public the repository but still not lucky.

Caused by: org.eclipse.jgit.errors.TransportException: Nothing to push.\n\t at org.eclipse.jgit.transport.Transport.push(Transport.java:1323)\n\tat org.eclipse.jgit.api.PushCommand.call(PushCommand.java:137)\n\t... 66 more\n"

Caused by: org.eclipse.jgit.errors.TransportException: https://bitbucket.mycompany.com/scm/test/test_thingworx_git.git: cannot open git-upload-pack at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:604) at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:361) at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:105) at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:91) at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1260) at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:211) ... 67 more Caused by: java.net.UnknownHostException: bitbucket.mycompany.com at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) at org.eclipse.jgit.transport.http.JDKHttpConnection.getResponseCode(JDKHttpConnection.java:85) at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:208) at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:509) ... 72 more

vrosu commented 1 year ago

Hi, In your error message there is the exception if you look carefully: "java.net.UnknownHostException: bitbucket.mycompany.com at" If you can checkout with user&pass then it should work the same in the Git Extension. Yes, the extension can use tokens (it's just replacing the pass with the token anyway)

vxba commented 1 year ago

Thank you! I will try again and let you know

vxba commented 1 year ago

Thank @vrosu The issue is from my company server.

I will close this issue