Session expired when using xcodebuild on MacOS over SSH

Hi,

We're trying to configure an EC2 MacOS to build our mobile application that went through a Ci/Cd (Jenkins) and we're facing an issue that shows something about a 'session expired' when running the xcodebuild command.

We're running this command to generate our build on this machine:

$ xcodebuild -exportArchive -archivePath ModularApp.xcarchive -exportOptionsPlist ./release.plist -exportPath ./ -allowProvisioningUpdates

Locally, this command runs with success when accessing this machine through the "macweb server" to access the GUI. But when running through a session over the SSH, it fails with this "Session expired".

macweb server link: https://www. macweb.com/)

We tried a lot of things that can be found on internet forums and nothing change the outcome. So, we need guidance to solve this issue and here's some info about our currently environment.

AWS EC2:

  • id ami: ami-0702ae65aba1217f3
  • Instance: mac1.metal
  • Processor: Intel Core i7
  • CPU: 12 vCPU
  • Memory: 32GB
  • Region: us-east-2

System OS:

  • MacOS 12.2 MontereyXcode 13.4.1

The error log we're facing:

2022-08-18 17:07:51.985 xcodebuild[41811:8837406]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={    creationTimestamp = "2022-08-18T17:07:52Z";    httpCode = 200;    protocolVersion = QH65B2;    requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action ";    responseId = "191ab8ef-8072-4aa3-8c5f-55db30c53938";    resultCode = 1100;    resultString = "Your session has expired. Please log in.";    userLocale = "en_US";    userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}

Full logs attached:

Regards,

Keychain doesn't work properly when you're connected using ssh. I believe that unlocking the keychain requires the plain text of your macOS login password, so it can't possibly work over ssh. It's not obvious why xcodebuild would need access to the keychain, but there are a billion other non-obvious things involved here.

Try running this immediately before invoking xcodebuild:

security unlock-keychain

@digao123 did you ever find a solution? I have the same problem.

same issue😭

Session expired when using xcodebuild on MacOS over SSH
 
 
Q