FileNotFound though URL correct

Issue #57 invalid
Former user created an issue

When trying to register a repo i got following error (see below). i testet the URL from error message with restclient and it works. hints in issue #51 dindnt help (as said URL is correct in my opinion)

2018-11-09 10:40:11,292 https-jsse-nio-443-exec-3 WARN dnk 640x225600x1 1qso90r 10.0.20.30 /browse/BRD-6 [c.a.r.j.p.w.children.condition.ChildIssuesPanelVisibilityCondition] Exception when evaluating if child issues panel should be displayed.
2018-11-09 10:40:15,787 https-jsse-nio-443-exec-20 WARN dnk 640x225647x1 1qso90r 10.0.20.30 /browse/BRD-16 [c.a.r.j.p.w.children.condition.ChildIssuesPanelVisibilityCondition] Exception when evaluating if child issues panel should be displayed.
09-Nov-2018 10:40:27.239 WARNING [https-jsse-nio-443-exec-9] com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters A servlet request, to the URI https://jira.fernbach.com/rest/jigit/1.0/repo/test, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
2018-11-09 10:40:27,241 https-jsse-nio-443-exec-9 ERROR trs 640x225685x1 f6orzy 10.0.16.33 /rest/jigit/1.0/repo/test [jigit.resource.JigitAdminResource] An exception was occurred while testing a repository foundation
java.io.FileNotFoundException: http://vm-git01/api/v4/projects/fernbach%2Ffoundation/repository/branches/master
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1836)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
        at api.client.http.ApiHttpRequester.parse(ApiHttpRequester.java:103)
        at api.client.http.ApiHttpRequester.withResultOf(ApiHttpRequester.java:76)
        at api.client.http.ApiHttpRequester.withResultOf(ApiHttpRequester.java:63)
        at jigit.client.gitlab.GitLabRepositoryAPI.getBranch(GitLabRepositoryAPI.java:51)
        at jigit.indexer.api.gitlab.GitLabAPIAdapter.getHeadCommitSha1(GitLabAPIAdapter.java:52)
        at jigit.resource.JigitAdminResource.testRepo(JigitAdminResource.java:147)
        ... 2 filtered
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        ... 13 filtered
        at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154)
        ... 1 filtered
        at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68)
        ... 32 filtered
        at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:56)
        ... 13 filtered
        at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
        ... 53 filtered
        at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
        ... 1 filtered
        at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
        ... 16 filtered
        at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
        ... 19 filtered
        at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
        ... 5 filtered
        at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:181)
        at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:137)
        at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:90)
        at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
        at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:174)
        at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:130)
        at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:121)
        ... 4 filtered
        at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:32)
        ... 8 filtered
        at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
        ... 4 filtered
        at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
        ... 26 filtered
        at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
        ... 23 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

Comments (6)

  1. Dmitrii Apanasevich repo owner

    Hi Jürgen,

    Which version of GitLab do you have? Do you use nginx to proxy requests to GitLab? Do you have any commit to master branch?

    Let's make a simple GitLab API call from JIRA server. You have to login to JIRA server via ssh and call API with the following command.

    curl -i --header "PRIVATE-TOKEN: {PUT_HERE_YOUR_SECRET_TOKEN}" "http://vm-git01/api/v4/projects/fernbach%2Ffoundation/repository/branches/master"
    
  2. Jürgen Späder

    Hi Dmitrii, we are running Gitlab CE GitLab Community Edition 11.2.3 06cbee3 as docker container (image https://hub.docker.com/r/gitlab/gitlab-ce/ is unchanged). Apparently this iomage is setup with an nginx. (see successfull try 2 below). port for ssh has been redirectd to 2222 due to port conflicts. There is no poxy in between. The test you mentioned is what we already tried out (see my original post) try 1 from extenal fails, try 2 from internal works.

    Try 1 (from external through firewall (http is open)):

    root@vm-jira:/tmp# curl -i --header "PRIVATE-TOKEN: {token}" "http://vm-git01/api/v4/projects/fernbach%2Ffoundation/repository/branches/master" -v
    *   Trying <git-ip>...
    * Connected to vm-git01 (<git-ip>) port 80 (#0)
    > GET /api/v4/projects/fernbach%2Ffoundation/repository/branches/master HTTP/1.1
    > Host: vm-git01
    > User-Agent: curl/7.47.0
    > Accept: */*
    > PRIVATE-TOKEN: <token>
    >
    < HTTP/1.1 404 Not Found
    HTTP/1.1 404 Not Found
    < Date: Mon, 12 Nov 2018 08:43:07 GMT
    Date: Mon, 12 Nov 2018 08:43:07 GMT
    < Server: Apache/2.4.9 (Unix) SVN/1.8.11
    Server: Apache/2.4.9 (Unix) SVN/1.8.11
    < Content-Length: 260
    Content-Length: 260
    < Content-Type: text/html; charset=iso-8859-1
    Content-Type: text/html; charset=iso-8859-1
    
    <
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL /api/v4/projects/fernbach/foundation/repository/branches/master was not found on this server.</p>
    </body></html>
    * Connection #0 to host vm-git01 left intact
    

    Try 2 from internal (with exact same URL/Token etc):

    [root@vm-ore-dly tmp]# curl -i --header "PRIVATE-TOKEN: <token>" "http://vm-git01/api/v4/projects/fernbach%2Ffoundation/repository/branches/master"
    HTTP/1.1 200 OK
    Server: nginx
    Date: Mon, 12 Nov 2018 08:32:46 GMT
    Content-Type: application/json
    Content-Length: 628
    Connection: keep-alive
    Cache-Control: max-age=0, private, must-revalidate
    Etag: W/"b2c74ebce28d2a0639e7681b963e8bf5"
    Vary: Origin
    X-Content-Type-Options: nosniff
    X-Frame-Options: SAMEORIGIN
    X-Request-Id: 82926fe4-cbad-45e3-ba76-041107844c56
    X-Runtime: 0.059295
    Strict-Transport-Security: max-age=31536000
    
    {"name":"master","commit":{"id":"a895bfc0272f406bc9c440bb520e05895636191f","short_id":"a895bfc0","title":"[artifactory-release] Next development version","created_at":"2018-11-09T07:19:02.000Z","parent_ids":["9bf78bd54edc8f7a274feae9b1c6b94c8ab00a2d"],"message":"[artifactory-release] Next development version\n","author_name":"jenkins","author_email":"jus@fernbach.com","authored_date":"2018-11-09T07:19:02.000Z","committer_name":"jenkins","committer_email":"jus@fernbach.com","committed_date":"2018-11-09T07:19:02.000Z"},"merged":false,"protected":true,"developers_can_push":false,"developers_can_merge":false,"can_push":true}[root@vm-ore-dly tmp]# ll
    
  3. Jürgen Späder

    Solved. Setting in DNS-Table of our Domain-Server (with domain) did the job. Now nginx is routing everything correctly. Thnx for quick reply though. Plugin works like a charme.

  4. Log in to comment