expo publish/build:ios - Request failed with status code 404

Hi, I’ve been having problems with expo publish or build:{ios,android} for the past 2 hours or so.

⟩ env EXPO_DEBUG=true expo publish
Unable to find an existing Expo CLI instance for this directory, starting a new one...
Starting Metro Bundler on port 19001.
Tunnel ready.
Publishing to channel 'default'...
Building iOS bundle
Building Android bundle
Finished building JavaScript bundle in 9124ms.
Analyzing assets
Finished building JavaScript bundle in 2595ms.
Finished building JavaScript bundle in 259ms.
Finished building JavaScript bundle in 2784ms.
Uploading assets
No assets changed, skipped.
Processing asset bundle patterns:
- <redacted>/src/assets/images/*
Uploading JavaScript bundles
Request failed with status code 404
Error: Request failed with status code 404
    at createError (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/adapters/http.js:237:11)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Tried expo build:ios, with the same result

⟩ env EXPO_DEBUG=true expo build:ios
Checking if there is a build in progress...

Unable to find an existing Expo CLI instance for this directory, starting a new one...
Starting Metro Bundler on port 19001.
Tunnel ready.
Publishing to channel 'default'...
Building iOS bundle
Building Android bundle
Finished building JavaScript bundle in 5989ms.
Analyzing assets
Finished building JavaScript bundle in 2530ms.
Finished building JavaScript bundle in 2372ms.
Finished building JavaScript bundle in 75ms.
Uploading assets
No assets changed, skipped.
Processing asset bundle patterns:
- <redacted>/src/assets/images/*
Uploading JavaScript bundles
Request failed with status code 404
Error: Request failed with status code 404
    at createError (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/adapters/http.js:237:11)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Is there are an issue with the build server ?

https://status.expo.io/ says everything is operational, but https://expo.io/turtle-status doesn’t look too good.

Same here. No idea why…

Error: Request failed with status code 404
    at createError (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/adapters/http.js:237:11)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Hi

Maybe you’ll get some useful information (e.g. what URL is it failing to fetch) if you set up a proxy server to examine the network traffic:

https://docs.expo.io/versions/latest/introduction/troubleshooting-proxies/

I tried publishing from the XDE and the end result is the same, although I can see a GraphQL error

25

Any idea where that may come from ?

Hi.

XDE is old and you should no longer use it. Please post the output of expo diagnostics as plain text like this:

```
output
here
```

Thank you wodin,

By XDE I meant the browser tab that opens when you run npm run ios from the command line (not sure if that’s XDE :slight_smile:)

This is expo diagnostics

⟩ expo diagnostics

  Expo CLI 3.0.10 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 10.16.2 - /usr/local/opt/node@10/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.10.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^33.0.0 => 33.0.3
      react: 16.8.3 => 16.8.3
      react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8
      react-navigation: ^3.11.0 => 3.11.0
    npmGlobalPackages:
      expo-cli: 3.0.10

OK, I don’t see anything wrong with the diagnostics.

I still think finding out what URL(s) is/are resulting in 404 errors would be useful. Are you able to set up a proxy to figure that out?

I’m not really an expert with proxy config, but let me try it

1 Like

So this is what I’m seeing with “Charles”

and this

Any ideas ?

OK, from looking at the code I see the following:

The “Uploading JavaScript bundles” message is logged in the above code. The code then calls Api.callMethodAsync passing it a second argument of null.

In the code above we can see that the URL is made up of a base URL, the method (“publish”) and args, which in this case is null. So that URL makes sense, although it seems a bit strange to me.

If I issue a GET request to that URL I get some JSON back telling me I’m not logged in, so the URL does indeed exist. I haven’t tried a manual PUT request :laughing:

So the URL does exist, but something is generating a 404 error. I suspect the backend is a Rails server. Rails can generate 404 errors if the code tries to find a record that does not exist, so this 404 could mean that something in the request body doesn’t match records that exist on the server side. (I’m being vague because I don’t know anything about the Expo team’s servers.)

It might be worth patching _uploadArtifactAsync in expo-cli’s packages/xdl/src/Project.ts file to log the contents of formData to see if that gives us any more hints.

See the following if you want to try that:

Setting up the repository for development

  1. Clone the repository.
  2. Run yarn run bootstrap . (Installs dependencies, links and builds packages.)
  3. Run git config commit.template .github/.COMMIT_TEMPLATE (Sets you up with our commit message template)

You can then run yarn start in the root folder to start watching and automatically re-building packages when there are new changes.

You know, Charles captured formData

and since last submission, we haven’t changed anything in package.jon nor app.json, except for the build number in app.json, the manifest seems ok, since it’s reading the correct build number (38)

formData does contain some FB and Google keys, but what can I provide to help troubleshoot ?

Sorry, yes, of course Charles would have captured that :sweat_smile:

I was hoping something in formData might give us some inspiration, but nothing in your screenshot jumps out at me. I’m running out of ideas :frowning:

@charliecruzan/@adamjnav any ideas what could cause the server to send back a 404 Not Found error when trying to PUT the JavaScript bundles to https://exp.host/--/api/publish/null while running expo publish? Or if that URL is incorrect, where things might be going wrong?

Thanks a lot for your help wodin !

Let’s hope we can get to the bottom of this issue.

I also just tried to remove node_modules and publish again, same 404 result.

2 Likes

I’d have to dig a little more. We had some reports of 404 responses to the build command back in July for newly-made accounts, but was fixed and had no further reports

No major changes to app.json since the last time you were publishing/building? Have you made any recent account settings changes? Longshot, but do you when was the last time you were able to publish/build successfully?

Hi,

  • Only changes to app.json were build number.
  • The account was recently created (about a week, 10 days ago), no change whatsoever since then
  • I was able to publish last Thursday, but on Friday I started getting the 404 error

Let me know if you need any additional info.

Thanks for looking into this :+1:

Also note that this happened with expo-cli v3.0.9, so I upgraded to v3.0.10, but still got the error.

Same here.

I’m getting a failure with status code 401

I have this error when i do expo publish

  • Request failed with status code 404

We’re having (I believe) the same issue on expo publish. I believe it started occurring after the expo.io site went down a few days ago but am not certain on this.

  • Request failed with status code 404