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

How to resolve Syncing error: Project must be checked out by supported schemes: SSH #259

Closed
reststop opened this issue May 6, 2016 · 12 comments
Labels

Comments

@reststop
Copy link

reststop commented May 6, 2016

Still new to setting up a syncer: I believe this error means the syncer is running, but cannot create bots or something else is not quite right.

Known working:

  • Can talk to server, shows bots we have setup
  • Can talk to the repository, shows current list of PRs

We do use SSH for all of our checkouts, so the error message is confusing as far as the problem.

And, yes, this is an issue in a fork of your main project, but I do not think the problem lies in that code. (although it might. I will create an issue on the forked project as well.)

Getting the following error: (msg pasted from xcode debug window, not from screen)
Actual msg showed 7 PRs, I trimmed it to just show 2....

`[INFO]: Sync starting at 2016-05-06 20:08:44 +0000
[VERBOSE]: Resolving prs:
PR 276: [F-12] average speed -> current speed, average pace -> current pace [k/F-12-workout -> develop]
PR 280: [F-11] Added FileHelper class for all your storage needs [a/F-11-assets -> develop]
and branches:

and bots:
Bot F Master
Bot F Bot
Bot F Distribution e2e
Bot F Distribution e2e2
Bot F Develop
Bot F Dev
[ERROR]: HTTPS or SVN not yet supported, please create an issue on GitHub if you want it added (czechboy0/Buildasaur)
[ERROR]: Syncing encountered a problem. Error: Couldn't create a Project for fork with origin at url https://[email protected]/fight/champion.git, error Error Domain=com.honzadvorsky.Buildasaur Code=0 "Disallowed checkout type, the project must be checked out over one of the supported schemes: SSH" UserInfo={NSLocalizedDescription=Disallowed checkout type, the project must be checked out over one of the supported schemes: SSH}. Context: Creating a bot from a PR
[VERBOSE]: SyncPair PR (k/12-workout) + No Bot finished sync after 0.001 seconds.
[ERROR]: HTTPS or SVN not yet supported, please create an issue on GitHub if you want it added (czechboy0/Buildasaur)
[ERROR]: Syncing encountered a problem. Error: Couldn't create a Project for fork with origin at url https://[email protected]/fight/champion.git, error Error Domain=com.honzadvorsky.Buildasaur Code=0 "Disallowed checkout type, the project must be checked out over one of the supported schemes: SSH" UserInfo={NSLocalizedDescription=Disallowed checkout type, the project must be checked out over one of the supported schemes: SSH}. Context: Creating a bot from a PR
[VERBOSE]: SyncPair PR (a/F-11-assets) + No Bot finished sync after 0.001 seconds.
[INFO]: Rate Limit: NO INFO
[INFO]: Sync finished with error at 2016-05-06 20:08:45 +0000, took 0.681 seconds.
`

@czechboy0
Copy link
Member

czechboy0 commented May 6, 2016

It looks like it's trying to read a project which is checked out over HTTPS instead of SSH: https://[email protected]/fight/champion.git

Can you try to check it out over SSH? If you're sure you did, look for a .xcblueprint or .xccheckout file in the workspace/project. If you find one, and see the HTTPS remote address there, edit it to reflect the SSH checkout path. Restart Xcode and Buildasaur (and delete already created bots by Buildasuar on Xcode Server). Let me know if that helped :)

@reststop
Copy link
Author

reststop commented May 6, 2016

Ok, I'll check the blueprint.
BTW, I forgot to sanitize the URLs. Can you edit your response and change the url you quoted to read:
[email protected]/fight/champion

@czechboy0
Copy link
Member

Done

@reststop
Copy link
Author

reststop commented May 6, 2016

Thanks!

No. it appears that the blueprint file also has the ssh: url. Where else might it have pulled that from?

I'm going to guess it might be constructed since I saw that the username was one used in the 'pod keys'. I'll look through the code gchiong did for the url's and see what's going on, but if you have any ideas of where it's being constructed (or should be gotten from, that will help)

I'll let you know what else I find.

@reststop
Copy link
Author

reststop commented May 6, 2016

Ok... stepping through the code...

In the init() for WorkspaceMetadata (called many times)
Up through the log msgs... that show the PRs, branches and bots, projectURLString is correctly using the SSH: URL.

Immediately after displaying the last bot, the next time through init() I see projectURLString is now re-written as the HTTPS: URL. The call stack looks like...

`
#0 0x0000000100c157bf in StandardSyncer.(createBotFromName in _BB9CC33E5AF71F4A071E69F7D21CE241)(String, branch : String, repo : RepoType, completion : () -> ()) -> () at //BuildaKit/SyncerBotManipulation.swift:63

#1 0x0000000100c16b38 in StandardSyncer.createBotFromPR(PullRequestType, completion : () -> ()) -> () at //BuildaKit/SyncerBotManipulation.swift:98

#2 0x0000000100b93a3d in static SyncPair_PR_NoBot.(createBotForPR in _854EE759CA2B7DD5E194647BC6094220)(syncer : StandardSyncer, pr : PullRequestType, completion : (error : NSError?) -> ()) -> () at //BuildaKit/SyncPair_PR_NoBot.swift:40

#3 0x0000000100b9377e in SyncPair_PR_NoBot.sync((error : NSError?) -> ()) -> () at //BuildaKit/SyncPair_PR_NoBot.swift:27

#4 0x0000000100c1478d in SyncPair.start((error : NSError?) -> ()) -> () at //BuildaKit/SyncPair.swift:42

#5 0x0000000100be8ef9 in StandardSyncer.(applyResolvedSyncPairs in _32F421478659A9AE408A2D9B93DF137C)([SyncPair], completion : () -> ()) -> () at //BuildaKit/SyncerLogic.swift:314

#6 0x0000000100be4b04 in StandardSyncer.syncPRsAndBranchesAndBots(repo : RepoType, repoName : String, prs : [PullRequestType], branches : [BranchType], bots : [Bot], completion : () -> ()) -> () at //BuildaKit/SyncerLogic.swift:175

#7 0x0000000100beb81f in StandardSyncer.((syncRepoWithPRsAndBranches in _32F421478659A9AE408A2D9B93DF137C)(String, repo : RepoType, prs : [PullRequestType], branches : [BranchType], completion : () -> ()) -> ()).(closure #1) at //BuildaKit/SyncerLogic.swift:149

#8 0x0000000100bea18f in partial apply for StandardSyncer.((syncRepoWithPRsAndBranches in _32F421478659A9AE408A2D9B93DF137C)(String, repo : RepoType, prs : [PullRequestType], branches : [BranchType], completion : () -> ()) -> ()).(closure #1) ()

#9 0x0000000100a86451 in XcodeServer.(getBots((bots : [Bot]?, error : NSError?) -> ()) -> ()).(closure #1) at //Pods/XcodeServerSDK/XcodeServerSDK/API Routes/XcodeServer+Bot.swift:84

#10 0x0000000100a99ad2 in XcodeServer.(sendRequestWithMethod(HTTP.Method, endpoint : XcodeServerEndpoints.Endpoint, params : [String : String]?, query : [String : String]?, body : NSDictionary?, portOverride : Int?, completion : (response : NSHTTPURLResponse?, body : AnyObject?, error : NSError?) -> ()) -> NSURLSessionTask?).(closure #1) at //Pods/XcodeServerSDK/XcodeServerSDK/XcodeServer.swift:138

#11 0x000000010048d83b in HTTP.(sendRequest(NSURLRequest, completion : (response : NSHTTPURLResponse?, body : AnyObject?, error : NSError?) -> ()) -> NSURLSessionTask).(closure #1) at //Pods/BuildaUtils/Source/HTTPUtils.swift:63
`

@reststop
Copy link
Author

reststop commented May 6, 2016

More info: At least on my local machine, and the xcode server, the response from git remote -v shows the SSH: URL.

@reststop
Copy link
Author

reststop commented May 6, 2016

Ok, tracing...

in SyncerBotManipulation.swift
in createBotFromName
setting headOriginURL...
repo.originURLSSH == https://[email protected]

Need to find out why that is set to that value, instead of the ssh: URL.

@reststop
Copy link
Author

reststop commented May 7, 2016

Looks like Stash and Bitbucket server may use different information....
In: BitBucketEnterpriseRepo.swift (gchiong's code)
clone[0] isn't always the right entry, I think.

I dug through the structure of the returned JSON and saw the HTTPS URL in a few places, but also saw an SSH URL so, will do some more digging.

`
required init(json: NSDictionary) {

    //split with forward slash, the last two comps are the repo
    //create a proper ssh url for bitbucket enterprise here
    let clone = json
        .dictionaryForKey("links")
        .arrayForKey("clone")
    let ssh:[String:String] = clone[0] as! [String : String]
    let sshURL = NSURL(string: ssh["href"]!)!

    self.originUrlSSH = sshURL.absoluteString //sshURL.host! + sshURL.path!

    super.init(json: json)
}

`

On my Stash server, this is setting the URL to HTTPS://...

@reststop
Copy link
Author

reststop commented May 9, 2016

Modified code... temporarily (not sure if I want the components changed [var vs. let], or if sshURL is ever used elsewhere)

    for cloneEntity:[String:String] in clone as! [Dictionary] {
        if cloneEntity["name"] == "ssh" {
            self.sshURL = NSURL(string: cloneEntity["href"]!)!
            self.originUrlSSH = sshURL.absoluteString //sshURL.host! + sshURL.path!
            break
        }
    }

// let ssh:[String:String] = clone[0] as! [String : String]
// let sshURL = NSURL(string: ssh["href"]!)!

This get's by the SSH vs HTTPS URL issue...
But now, I'm seeing another issue...

@czechboy0
Copy link
Member

@reststop Interesting, some of this might be the issue in the fork's code. Would you maybe want to see what's been changed? I'm afraid I can't help with what's been changed in the fork. Unless you bring the author into this conversation so that we could discuss it here 😊

@reststop
Copy link
Author

I've exchanged an email with gchiong and have something to look into.

@czechboy0
Copy link
Member

I think this was also resolved as an issue of the fork of handling the Stash repo. If there's a bug in main Buildasaur code, please open a ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants