React-native-code-push: Error: Failed to release a CodePush update.

Created on 23 May 2018  路  12Comments  路  Source: microsoft/react-native-code-push

Steps to Reproduce

  1. Running the command
    appcenter codepush release-react -m --description "Publish last changes" -d Production

Expected Behavior

Publish the changes without issues

Actual Behavior

What actually happens?

Detecting ios app version:

Using the target binary version value "1.0.9" from "ios\appName\Info.plist".

Running "react-native bundle" command:

node node_modules\react-native\local-cli\cli.js bundle --assets-dest C:\Users\seven\AppData\Local\Temp\code-push118423-2664-wevgk6.x8048cl3di\CodePush--bundle-output C:\Users\seven\AppData\Local\Temp\code-push118423-2664-wevgk6.x8048cl3di\CodePush\main.jsbundle --dev false --entry-file index.js --platform ios
Scanning folders for symlinks in C:\dev\newapppoc\react-native\node_modules (16ms)
Scanning folders for symlinks in C:\dev\newapppoc\react-native\node_modules (31ms)
Loading dependency graph, done.
bundle: start
bundle: finish
bundle: Writing bundle output to: C:\Users\seven\AppData\Local\Temp\code-push118423-2664-wevgk6.x8048cl3di\CodePush\main.jsbundle
bundle: Done writing bundle output
bundle: Copying 33 asset files
bundle: Done copying assets

Releasing update contents to CodePush:

Error: Failed to release a CodePush update.

Environment

  • react-native-code-push version: ^5.2.1
  • react-native version: 0.52.1
  • app-center: ^1.2.0

Regards, Nicholls

waiting-for-clarification

Most helpful comment

Hi @jdnichollsc, thanks for reporting!

Please try to execute code-push release-react <app-name> ios -m --description "Publish last changes" -d Production command and let me know whether it finished successfully or not.

All 12 comments

And running the command with --debug option =>
appcenter codepush release-react -m --description "Publish last changes" -d Production --debug

Output from terminal

Using appcenter-cli version: 1.0.17
logFilter, request: {
  "rawResponse": false,
  "queryString": {},
  "url": "https://api.appcenter.ms/v0.1/apps/AppName/AppName-iOS/deployments/Production",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json; charset=utf-8",
    "user-agent": "appcenterCli/1.0.17 NodeJS/v6.3.0 win32/10.0.16299",
    "x-api-token": "....",    "internal-request-source": "cli",    "diagnostic-context": "046914b1-6522-40ba-95c5-f96281357ad8",    "cli-command-name": "codepush release-react"
  },
  "body": null
}
Response status code: 200
Body: {"name":"Production","key":"....","latest_release":{"target_binary_range":"1.0.9","blob_url":"https://codepush.blob.core.windows.net/storagev2/34boekD07SmvRGcH3ZmGoYBlXiLNfecab3b1-de72-413a-82bf-69736ab347ce","description":"Update resources to match with the last version","is_disabled":false,"is_mandatory":true,"label":"v2","package_hash":"cfa1b0d735745659a1654e60c4f166838fb63e425f3d141e153a8beaecdd9c7d","released_by":"devs@...","release_method":"Upload","rollout":100,"size":6062983,"upload_time":1519916122407,"diff_package_map":{"1b77f313a2f7fd9400577da71f85003d811d9acaf42911eb9076af6b1dd1e1b9":{"size":364070,"url":"https://codepush.blob.core.windows.net/storagev2/Nmo86FCaqE_gMwKvtYujpwGVZsBbfecab3b1-de72-413a-82bf-69736ab347ce"}}}}
| Getting app info...logFilter, request: {
  "rawResponse": false,
  "queryString": {},
  "url": "https://api.appcenter.ms/v0.1/apps/AppName/AppName-iOS",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json; charset=utf-8",
    "user-agent": "appcenterCli/1.0.17 NodeJS/v6.3.0 win32/10.0.16299",
    "x-api-token": "...",
    "internal-request-source": "cli",
    "diagnostic-context": "046914b1-6522-40ba-95c5-f96281357ad8",
    "cli-command-name": "codepush release-react"
  },
  "body": null
}
- Getting app info...Response status code: 200
Body: {"id":"fd703977-28a7-499b-a128-179a511b1cef","app_secret":"....","description":null,"display_name":"AppName-iOS","name":"AppName-iOS","os":"iOS","platform":"React-Native","origin":"appcenter","icon_url":null,"created_at":"2018-01-19T17:00:34.000Z","updated_at":"2018-01-19T17:00:34.000Z","owner":{"id":"....","avatar_url":null,"display_name":"AppName","email":"...","name":"AppName","type":"user"},"azure_subscription":null,"member_permissions":["manager"]}
Detecting ios app version:

Using the target binary version value "1.0.9" from "ios\appName\Info.plist".

Running "react-native bundle" command:

node node_modules\react-native\local-cli\cli.js bundle --assets-dest C:\Users\seven\AppData\Local\Temp\code-push118423-32612-ttdtky.lnwk0ara4i\CodePush --bundle-output C:\Users\seven\AppData\Local\Temp\code-push118423-32612-ttdtky.lnwk0ara4i\CodePush\main.jsbundle --dev false --entry-file index.js --platform ios
Scanning folders for symlinks in C:\dev\newapppoc\react-native\node_modules (24ms)
Scanning folders for symlinks in C:\dev\newapppoc\react-native\node_modules (23ms)
Loading dependency graph, done.
bundle: start
bundle: finish
bundle: Writing bundle output to: C:\Users\seven\AppData\Local\Temp\code-push118423-32612-ttdtky.lnwk0ara4i\CodePush\main.jsbundle
bundle: Done writing bundle output
bundle: Copying 34 asset files
bundle: Done copying assets

Releasing update contents to CodePush:

Error: Failed to release a CodePush update.

Please remove your tokens from the debug output

@ajwhite woww thanks for report that!

Hi @jdnichollsc, thanks for reporting!

Please try to execute code-push release-react <app-name> ios -m --description "Publish last changes" -d Production command and let me know whether it finished successfully or not.

Hi @NickToropov, thanks for the quickly response!

Same issue, check the output from Windows for Android in this case

Detecting android app version:

Using the target binary version value "1.0" from "android\app\build.gradle".

Running "react-native bundle" command:

node node_modules\react-native\local-cli\cli.js bundle --assets-dest C:\Users\seven\AppData\Local\Temp\CodePush\CodePush --bundle-output C:\Users\seven\AppData\Local\Temp\CodePush\CodePush\index.android.bundle --dev false --entry-file index.js --platform android
Scanning folders for symlinks in C:\dev\newapppoc\react-native\node_modules (19ms)
Scanning folders for symlinks in C:\dev\newapppoc\react-native\node_modules (52ms)
Loading dependency graph, done.

bundle: start
bundle: finish
bundle: Writing bundle output to: C:\Users\seven\AppData\Local\Temp\CodePush\CodePush\index.android.bundle
bundle: Done writing bundle output
bundle: Copying 36 asset files
bundle: Done copying assets

Releasing update contents to CodePush:

Upload progress:[=============================                     ] 59% 3.9s[Error]  write ECONNRESET

Hi @jdnichollsc, the most likely reason of the fail is a network issue. Please check the result for the following url https://codepush-management.azurewebsites.net/health. It should return Healthy.

@NickToropov yes, the same result "Healthy"

@jdnichollsc do you have a chance to try to release this from another machine? (I'd like to see if the issue is with your machine configuration or with code-push endpoint).

@NickToropov of course, I have executed the same command from a MacBook Pro (Touchbar) and from Windows, and the same output keeps coming

@NickToropov executing the same script from AppCenter using a appcenter-post-build.sh works perfect, so I don't know what's the problem from Colombia...

My beautiful script appcenter-post-build.sh:

#!/usr/bin/env bash

# Example: Install App Center CLI
npm install -g appcenter-cli

ENVIRONMENT=Develop
APP_NAME=CompanyName/AppName-iOS
TOKEN=mytoken

if [ "$APPCENTER_BRANCH" == "master" ];
then
    ENVIRONMENT=Production
fi
if [[ -z "$APPCENTER_XCODE_PROJECT" ]]; then
    APP_NAME=CompanyName/AppName-Android
fi

echo "**************** PUBLISH CHANGES WITH CODEPUSH ******************"
echo "APP NAME               => $APP_NAME"
echo "CURRENT ENVIRONMENT    => $ENVIRONMENT"
echo "SELECTED RN PACKAGE    => $APPCENTER_REACTNATIVE_PACKAGE"
echo "SELECTED XCODE PROJECT => $APPCENTER_XCODE_PROJECT"
echo "ANDROID VARIANT        => $APPCENTER_ANDROID_VARIANT"

appcenter codepush release-react -a "$APP_NAME" -m --description "Update app" -d "$ENVIRONMENT" --token "$TOKEN"

Thanks for the help, Nicholls

@jdnichollsc, thanks for getting back, that is good that the issue is resolved finally, I鈥檓 closing this one right now but let me know if you will see anything related you can share with us going further

I was successfully able to upload codepush build. However, now I am getting this error. I tried create entirely a new build.
Still facing the issue. Please suggest

appcenter codepush release-react -a / --description "testing" -d Staging

Error: Error: The asset cannot be uploaded. Try creating a new one

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DeDuckProject picture DeDuckProject  路  3Comments

vira-khdr picture vira-khdr  路  3Comments

jaysig picture jaysig  路  3Comments

panarasi picture panarasi  路  4Comments

diegocouto picture diegocouto  路  4Comments