buildasaurs / XcodeServerSDK

Access Xcode Server API with native Swift objects.
MIT License
399 stars 30 forks source link

Cancel API not working #134

Closed pavm035 closed 8 years ago

pavm035 commented 8 years ago

Hi,

Please refer to this link http://stackoverflow.com/questions/37336446/xcode-server-cancel-api-the-network-connection-was-lost

Thanks in advance

czechboy0 commented 8 years ago

Hi @pavm035,

that's very strange, I use XcodeServerSDK in Buildasaur and cancelling seems to work just fine. Can you please try to manually calling the API, something like

curl -k -u XCSUSERNAME:XCSPASSWORD -X POST https://127.0.0.1:20343/api/integrations/INTEGRATION_ID/cancel

where the INTEGRATION_ID you can get by e.g. installing xcskarel and with it running xcskarel integrations --bot "My Bot Name" and supplying the bot name there? You'll get a list of integrations, just copy the hash of the one you want to cancel into the curl call above and try to run it.

Let me know if that works. Please make sure you're supplying correct username and password, because for reading, XCS usually allows anyone access, but for writing (e.g. canceling), you need to provide credentials. So please make sure you're using XcodeServerSDK properly with credentials.

pavm035 commented 8 years ago

Hi @czechboy0 ,

Thanks for your quick response, I tried that CURL command but i'm getting "curl: (56) SSLRead() return error -9806", looks like some SSL issue. I tried googling for self-signing or disabling the ssl certification with curl -k -u XCSUSERNAME:XCSPASSWORD -X POST https://127.0.0.1:20343/api/integrations/INTEGRATION_ID/cancel --insecure, still giving same error

Thanks Pavan

czechboy0 commented 8 years ago

Hi @pavm035, I once again tried it locally and the manual command you posted works just fine. The error you're getting looks like a curl/OpenSSL issue. Unfortunately there's nothing I can fix in XcodeServerSDK, sorry.