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

Failed to access server, error: 404: for GitHub #278

Closed
reststop opened this issue May 27, 2016 · 3 comments
Closed

Failed to access server, error: 404: for GitHub #278

reststop opened this issue May 27, 2016 · 3 comments

Comments

@reststop
Copy link

reststop commented May 27, 2016

Tracking down a previous issue, I removed the offending entry from Projects.json and went through the steps of replicating the problem.

I added some extra log statements to BuildaUtils and I notice that when creating a new Syncer, for a project on the public GitHub, the Project screen shows the correct URL using SSH, and there are no SSH errors. However, the URL actually used to connect to GitHub is an HTTPS request.

GitHub responds with a 404.

I have a suspicion that this might be due to changes made by the fork/branch I'm using but wasn't expecting it since I we expecting Buildasaur to be able to talk to different repositories as needed. I will continue to research and try to fix the issue. I've bolded the part of the URL that makes me suspicious. (Of course the bolding didn't work inside a 'pre' block). Search for '**' below).

Here is my Log with the extra info I got:

[VERBOSE]: HTTPUtils sendRequest: Optional("GET")  { URL: https:/**rest/api/1.0/projects**/reststop/**repos**/Buildasaur }
[VERBOSE]: HTTPUtils sendRequest: Optional(["Authorization": "Basic somehash"])
[VERBOSE]: HTTPUtils Response: 404  { URL: https:/**rest/api/1.0/projects**/reststop/**repos**/Buildasaur } { status code: 404, headers {
    "Content-Encoding" = gzip;
    "Content-Security-Policy" = "default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com www.google-analytics.com collector.githubapp.com *.gravatar.com *.wp.com avatars0.githubusercontent.com avatars1.githubusercontent.com avatars2.githubusercontent.com avatars3.githubusercontent.com; media-src 'none'; object-src assets-cdn.github.com; plugin-types application/x-shockwave-flash; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com";
    "Content-Type" = "text/html; charset=utf-8";
    Date = "Fri, 27 May 2016 00:20:22 GMT";
    "Public-Key-Pins" = "max-age=5184000; pin-sha256=\"somehash\"; pin-sha256=\"somehash\"; pin-sha256=\"somehash\"; pin-sha256=\"somehash\"; pin-sha256=\"somehash\"; pin-sha256=\"somehash\"; pin-sha256=\"somehash\"; includeSubDomains";
    Server = "GitHub.com";
    Status = "404 Not Found";
    "Strict-Transport-Security" = "max-age=31536000; includeSubdomains; preload";
    "Transfer-Encoding" = Identity;
    "X-Content-Type-Options" = nosniff;
    "X-Frame-Options" = deny;
    "X-GitHub-Request-Id" = "C0373624:3A86:973F6AD:574792C6";
    "X-Request-Id" = 1484b897a8cf022ea2598b1ba34b1290;
    "X-Runtime" = "0.002521";
    "X-XSS-Protection" = "1; mode=block";
} }
[VERBOSE]: HTTPUtils Response: [Content-Type: text/html; charset=utf-8, Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com www.google-analytics.com collector.githubapp.com *.gravatar.com *.wp.com avatars0.githubusercontent.com avatars1.githubusercontent.com avatars2.githubusercontent.com avatars3.githubusercontent.com; media-src 'none'; object-src assets-cdn.github.com; plugin-types application/x-shockwave-flash; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com, X-Runtime: 0.002521, X-XSS-Protection: 1; mode=block, Server: GitHub.com, Content-Encoding: gzip, Transfer-Encoding: Identity, X-GitHub-Request-Id: C0373624:3A86:973F6AD:574792C6, Date: Fri, 27 May 2016 00:20:22 GMT, X-Request-Id: 1484b897a8cf022ea2598b1ba34b1290, Strict-Transport-Security: max-age=31536000; includeSubdomains; preload, Public-Key-Pins: max-age=5184000; pin-sha256="somehash"; pin-sha256="somehash"; pin-sha256="somehash+"; pin-sha256="somehash+="; pin-sha256="somehash"; pin-sha256="somehash"; pin-sha256="somehash"; includeSubDomains, X-Content-Type-Options: nosniff, Status: 404 Not Found, X-Frame-Options: deny]
@reststop
Copy link
Author

I'm just guessing, but I would think that in the following block, service_type should be the type of server, such as "github", "bitbucket", "gitlab", "bitbucket-server", "etc." and then the correct service should be called.

Methinks the branch I'm working with may ONLY talk to bitbucket-server/stash.

Correct me if this is reasonable / correct / wrong / ...

[
  {
    "service_type" : "github",
    "ssh_public_key_url" : "\/Users\/user\/.ssh\/id_rsa.pub",
    "id" : "2D993DA2-2E3B-4C12-B3C3-0CDD1EC3CCD2",
    "url" : "\/Users\/user\/buildasaur\/buildasaur\/Buildasaur.xcworkspace",
    "ssh_private_key_url" : "\/Users\/user\/.ssh\/id_rsa"
  },
  {
    "service_type" : "github",
    "ssh_public_key_url" : "\/Users\/user\/.ssh\/id_rsa.pub",
    "id" : "19D91C4D-04B8-4088-9D96-51DBFE479D13",
    "url" : "\/Users\/user\/name\/myrepo\/Name\/Name.xcworkspace",
    "ssh_private_key_url" : "\/Users\/user\/.ssh\/id_rsa"
  },
  {
    "service_type" : "github",
    "ssh_public_key_url" : "\/Users\/user\/.ssh\/id_rsa.pub",
    "id" : "AB5EDAF0-8C6B-4401-ABE1-188F0CC45C0F",
    "url" : "\/Users\/user\/buildasaur\/myrepo\/Buildasaur.xcworkspace",
    "ssh_private_key_url" : "\/Users\/user\/.ssh\/id_rsa"
  }
]

More to do, I think....

@reststop
Copy link
Author

reststop commented May 27, 2016

Time to revisit forking directly off your branch and adding services for Stash as different than bitbucketEnterprise/bitbucketServer... ;-)

What I have works "mostly", but apparently doesn't handle multiple repository types, or the part that creates the Project.json isn't updated correctly.

@czechboy0
Copy link
Member

Yeah the links above look suspicious, those must be added in the fork. Please consult the author directly, sorry I can't be of much help here.

The pending PR for adding GitHub Enterprise actually is some good work and I'm willing to accept it (I was just waiting for someone else to give it a try and verify it works as I cannot do that myself). So if you want to add Stash support yourself, probably fork off that branch on #251

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