iOS build failing: "Error while gathering & validating credentials", "Request failed with status code 404"

Since last evening I’ve been hitting this error when trying to run EXP_DEBUG=true exp build:ios --release-channel prod (note I have axios-debug-logging installed, was hoping to see which URL was causing the 404 error):

? How would you like to upload your credentials?
 Expo handles all credentials, you can still provide overrides

We need your Apple ID/password to manage certificates and
provisioning profiles from your Apple Developer account.

Note: Expo does not keep your Apple ID or your Apple password.

? What's your Apple ID? REDACTED
? Password? [hidden]
[14:52:09] Validating Credentials...
To run _spaceship_ through a local proxy, use SPACESHIP_DEBUG

[14:52:11] You have 2 teams
1) REDACTED
2) REDACTED
? Which Team ID to use? 2) REDACTED
To run _spaceship_ through a local proxy, use SPACESHIP_DEBUG

? Will you provide your own Distribution Certificate? Let Expo handle the process
? Will you provide your own Push Certificate? Let Expo handle the process
? Would you like to reuse Distribution Certificate from another app? Used in apps: REDACTED
⠙ Now producing files for pushCertTo run _spaceship_ through a local proxy, use SPACESHIP_DEBUG

⠙ Now producing files for provisioningProfileTo run _spaceship_ through a local proxy, use SPACESHIP_DEBUG

[14:52:26] Error while gathering & validating credentials
[14:52:26] Error: Request failed with status code 404
[14:52:26] Request failed with status code 404
[14:52:26] Error: Request failed with status code 404
    at createError (/usr/local/lib/node_modules/exp/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/local/lib/node_modules/exp/node_modules/axios/lib/core/settle.js:18:12)
    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/exp/node_modules/axios/lib/adapters/http.js:191:11)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1081:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

My environment and setup is as follows:

Environment:
  OS: macOS Sierra 10.12.6
  Node: 10.4.0
  Yarn: 1.7.0
  npm: 6.1.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  expo: ^27.0.1 => 27.0.2
  react: 16.3.1 => 16.3.1
  react-native: https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz => 0.55.2

Diagnostics report:
  https://exp-xde-diagnostics.s3.amazonaws.com/drive.ai-72f2f06d-4360-4799-baec-eb9ba2a07bf9.tar.gz

I noticed that another developer has run into the same issue today: exp build:ios Error while gathering & validating credentials (status code 404)

It does not appear transient however: I have been hitting this 404 error now for over 12 hours no matter how many times I retry.

Adding more debug logging, we see this as the failing URL (same as “nfen” saw in exp build:ios Error while gathering & validating credentials (status code 404)):

{ hostname: 'exp.host',
  port: null,
  path: '/--/api/updateCredentials/%5B%5D',
  method: 'post',
  headers:
   { Accept: 'application/json, text/plain, */*',
     'Content-Type': 'application/json;charset=utf-8',
     'Exp-ClientId': 'c--kniJmVRQyitCtNZoDg8aw',
     'Expo-Session':
      '{"id":"c7e31cb8-b202-4c39-b607-a5c4255f215d","version":1,"expires_at":1893456000000}',
     'User-Agent': 'axios/0.16.2',
     'Content-Length': 17130 },
  agent: undefined,
  auth: undefined }

Hi, we’re looking into this. It looks like there are some DB entries that fail some invariants. We are adding some more diagnostics to figure out the root cause right now.

2 Likes

Thank you so much. I’m looking forward to hearing from You!

Awesome! Thanks a ton for getting onto this so quickly, it’s much appreciated.

@drive.ai
Hello,
I just deployed a fix, which should probably let you build your app again.
I’m curious about one thing. Did you change bundle_identifier in your app.json? I guess this was causing the problem on our servers.
Sorry for the trouble.

1 Like

@dsokal & @ide

it’s working well now. I’ve built successfully.
I really appreciated your support.
Thank You so much!

Cheer Expo Team!

1 Like

@ide: thanks so much for expediting the fix to this issue, it is very much appreciated! I am indeed back to building successfully.

I had been building different release channels (test, prod) with different bundle IDs, but the build that was failing for me was our main bundle ID (ai.drive.app) which I had built many times successfully before. Maybe it was that anyway?

Either way, thank you again very much. Cheers Expo team indeed!! :beers:

Yes, we believe the issue matches the symptoms you were seeing. We had a database constraint that didn’t allow for changing native bundle IDs while keeping the same Expo project name. That constraint now allows for changes to bundle IDs.

1 Like

I am facing the same issue.

12:37:33 [exp] Validating Credentials…
12:37:35 [exp] Error while gathering & validating credentials
12:37:35 [exp] Reason:Unknown reason, raw:"{\"authType\"=>\"sa\"}\naa=1D404262C361DDFDE1F94F29CE1C3ADB; Domain=idmsa.apple.com; Path=/; Secure; HttpOnly, dslang=US-EN; Domain=apple.com; Path=/; Secure; HttpOnly, site=USA; Domain=apple.com; Path=/; Secure; HttpOnly, acn01=81yX8PlM2WiIMr6cPP5Dh+SF9r7v0rv+/7shukN2agAdHVOkmklD; Max-Age=31536000; Expires=Tue, 02-Jul-2019 07:07:35 GMT; Domain=apple.com; Path=/; Secure; HttpOnly"

Here is the stack trace:

12:47:28 [exp] Error: Reason:Unknown reason, raw:"{\"authType\"=>\"sa\"}\naa=CC9E16D329C2C679028B043BDEF9DDFA; Domain=idmsa.apple.com; Path=/; Secure; HttpOnly, dslang=US-EN; Domain=apple.com; Path=/; Secure; HttpOnly, site=USA; Domain=apple.com; Path=/; Secure; HttpOnly, acn01=5dOFRwf6Ybj82MUUteNnANOZ+eA+WhTeITLYyTOvogAdHd2hfXeY; Max-Age=31536000; Expires=Tue, 02-Jul-2019 07:17:27 GMT; Domain=apple.com; Path=/; Secure; HttpOnly"
    at Object._callee4$ (/exp@54.0.0/src/commands/build/auth.js:127:11)
    at tryCatch (/usr/local/lib/node_modules/exp/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/exp/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/exp/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/usr/local/lib/node_modules/exp/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /usr/local/lib/node_modules/exp/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

All good mate, updated my exp to latest version, then I got the reason.

[13:05:15] Reason:Unknown reason, raw:“Need to acknowledge to Apple’s Apple ID and Privacy statement. Please manually log into https://appleid.apple.com (or https://itunesconnect.apple.com) to acknowledge the statement.”

Did that manually, now it’s fine.

Hope this will help, if anyone else is facing this issue.
Thanks.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.