Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

"Unable to merge" error for organization repo #146

Closed
vasily-v-ryabov opened this issue Oct 25, 2015 · 19 comments
Closed

"Unable to merge" error for organization repo #146

vasily-v-ryabov opened this issue Oct 25, 2015 · 19 comments
Labels

Comments

@vasily-v-ryabov
Copy link

Trying to merge any pull request for an organization fails immediately with the following error message: "Unable to merge! The server cannot locate the resources."

CodeHub 2.3.7, iOS 8.

@dillonb123
Copy link

Good eye. I actually just fixed this and pushed out a release. Apple is currently reviewing it now so hopefully it won't be too long before its in your hands.

On Oct 25, 2015, at 2:07 PM, Vasily Ryabov notifications@github.com wrote:

Trying to merge any pull request for an organization fails immediately with the following error message: "Unable to merge! The server cannot locate the resources."

CodeHub 2.3.7, iOS 8.


Reply to this email directly or view it on GitHub.

@thedillonb
Copy link
Collaborator

This has been fixed in the latest release (2.3.8)

@vasily-v-ryabov
Copy link
Author

The failure is still here. CodeHub 2.3.8, iOS 9.1.
Cannot merge with the same error.

@thedillonb thedillonb reopened this Nov 13, 2015
@thedillonb
Copy link
Collaborator

Ah I see what you're talking about. It looks like there was actually two problems. The one I had corrected was with missing commit messages. The one I think you're hitting is the fact that the "Merge" button is appearing when you don't actually have permissions to merge that PR. For example, when I go to a repo I don't own, look at a PR, and click the merge button, I get the error again.

Is this what you're also seeing?

@vasily-v-ryabov
Copy link
Author

@thedillonb I'm an owner of the organization. I've already merged the PR from the desktop browser. BTW, the PR was sent from another member of the organization (he also has push access, but we created the PR to verify the fix - "merge" still fails).

@vasily-v-ryabov
Copy link
Author

As I mentioned in #148, the pull request creator is also a member of "Contributors" group that has write access to each repo in the organization. It was set in the repo settings explicitly.

We can create test organization for emulating pretty the same situation.

@thedillonb
Copy link
Collaborator

@vasily-v-ryabov, I, for the life of me, cannot reproduce this. I've tried creating new organizations with a team setup like you described - nothing. However, I do have a long shot that I want to see if you can confirm.

In a browser, go to your Org. Go to that Org's "Settings", then to "Third-Party Access". What is the policy set to? Is it "Access Restricted"? I get that exact same issues you're describing if it's enabled. When it's enabled, it only allows public access to your organization, which would explain why you can't merge, comment, or change labels. All of which are displaying themselves as weird error messages that I can fix, but this might be the underlying problem.

@vasily-v-ryabov
Copy link
Author

@thedillonb, that's interesting. Thanks! I'll take a look at this when I have a chance (hopefully next week).

@vasily-v-ryabov
Copy link
Author

@thedillonb , you're right. This is set to "Access restricted". I can unset it, though it's not a secure way. I'll check this workaround and will close the issues.

But...
Is it possible to register your own CodeHub service (GitHub API app) to allow an access securely as several CI services do? iOS app might request GitHub API application access for the organization by opening it through Safari browser for example. Yeah, there is plenty of work. Just trying to mention all possible ways to handle it right way in a future.

@thedillonb thedillonb added the bug label Feb 27, 2016
@jyaworski
Copy link

I'm also running into this, I believe. Server cannot find the requested resource, or similar, when I try to merge from the app. I have 2FA enabled.

@thedillonb
Copy link
Collaborator

Hello @jyaworski, sorry to hear your having trouble. Are you trying to merge a pull-request that belongs to an organization?

@jyaworski
Copy link

The repo is under an organization, yes.

@thedillonb
Copy link
Collaborator

99% of the time it is an organization access policy that is causing the merge error. What's happening is that GitHub does not actually recognize the app as being allowed to access organization resources. You can view all you want, but not actually alter (merge) anything. To fix this, try the following:

  1. Go to GitHub.com
  2. Go to your profile settings (top right icon, drop down, bottom of list)
  3. At the bottom left, you should see your organization. Click on it.
  4. Go to "Third Party Access" and check the policy.

You may have to grant CodeHub access to the org explicitly. This was a change GitHub made a while ago to prevent rouge 3rd Party applications from getting into organization repositories and causing chaos.

Let me know if that works.

@jyaworski
Copy link

Actually, it appears that comments fail as well. On issues under that organization.

@daenney
Copy link

daenney commented Mar 13, 2016

@jyaworski And in this case, voxpupuli, that's exactly on purpose. We don't want people to just randomly be able to connect any SaaS app they feel they should be allowed to use while they, the first time around, will be the only ones giving consent about the data that's collected about them, the org and all other members. That's not a decision anyone should just make on behalf of a group without talking to that group first and getting that agreed upon.

Travis in our case is explicitly white-listed because it's used for all our CI. Any other tool is up for discussion but not a unilateral decision.

@jyaworski
Copy link

I was not aware of Github's permissions scheme. Then this is the intentional behavior and not a bug.

Sorry for the noise.

@thedillonb
Copy link
Collaborator

@jyaworski no worries! This hits a lot of people. I'd put some logic into CodeHub to warn users but I haven't yet figured out how to determine if a user could be part of an organization if the organization policy is set to deny 3rd-party access.

@thedillonb
Copy link
Collaborator

I'm closing this as I believe all issues within this thread have been resolved. If not, please re-open. Organizational access is one of the biggest pain points with the app. Unfortunately, the app cannot do anything related to organizations it doesn't know exists - because GitHub does not even divulge their existence to the app. I will continue to work on publicizing this to, hopefully, avoid this in the future.

@sbamin
Copy link

sbamin commented May 17, 2018

My question is more pertaining to #352 but guess discussions are more relevant here.

Just wonder if there should be a way to have at-least read-only access for org repositories based on scopes set using personal access token? This is similar to serverless issueboard setup where api token (and incoming webhook) is used to pull issues (and tags, milestones, etc. depending upon scopes set) from org repositories.

If there is a way to enable login to github based on personal access token (similar to enterprise login), org level issues can accessed. Of course, better way is to get OAuth approval from organization owner but that may not be practical to grant org wide privileges to an app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

6 participants