pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

Internal Server Error (500): APPX package generation failed. Error: Failed to unpack the uploaded content archive. #287

Open devunion opened 6 years ago

devunion commented 6 years ago

I was able to build APPX for Edge extension in the morning, but started to get the next exception after a couple of hours:

[debug] manifoldjs : Loading platform module: manifoldjs-edgeextension [debug] manifoldjs : Packaging the 'Microsoft Edge Extension Platform' app... [info ] edgeextension: Packaging the Microsoft Edge Extension Platform app... [debug] manifoldjs : Unable to create the package locally. Invoking the CloudAppX service instead... [debug] manifoldjs : Invoking the CloudAppX service... [error] manifoldjs : Failed to package the Microsoft Edge Extension Platform app. at C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\manifoldjs-lib\lib\projectBuilder.js:140:29 at _rejected (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:864:24) at C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:890:30 at Promise.when (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:1142:31) at Promise.promise.promiseDispatch (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:808:41) at C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:624:44 at runSingle (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:137:13) at flush (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) Failed to create the package. The CloudAppX service returned an error - Internal Server Error (500): APPX package generation failed. Error: Failed to unpack the uploaded content archive. at Request._callback (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\manifoldjs-edgeextension\lib\appPackage.js:72:32) at Request.self.callback (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\request\request.js:186:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\request\request.js:1163:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage.<anonymous> (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\request\request.js:1085:12) at Object.onceWrapper (events.js:313:30) at emitNone (events.js:111:20) [error] manifoldjs : One or more platforms could not be generated successfully. at C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\manifoldjs-lib\lib\projectBuilder.js:28:23 at _fulfilled (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:854:54) at self.promiseDispatch.done (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:883:30) at Promise.promise.promiseDispatch (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:816:13) at C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:624:44 at runSingle (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:137:13) at flush (C:\Users\Ириша\AppData\Roaming\npm\node_modules\manifoldjs\node_modules\q\q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9)

My build script is based on this tutorial: https://docs.microsoft.com/en-us/microsoft-edge/extensions/guides/packaging/using-manifoldjs-to-package-extensions

PS. Also can't build the app with the help of makeappx.exe tool. It fails with empty error message. Does anyone have an idea how to pack Edge extension?

boyofgreen commented 6 years ago

Hello, I've reached out to a few of the devs who support it. What OS are you working on?

devunion commented 6 years ago

Windows 10. I saw this problem on my local machine and another one virtual which is located in another country.

16 февр. 2018 г. 11:57 ПП пользователь "Jeff Burtoft" < notifications@github.com> написал:

Hello, I've reached out to a few of the devs who support it. What OS are you working on?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pwa-builder/ManifoldJS/issues/287#issuecomment-366356071, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAyeK7OqG6ARqrx0AxOWf8J9AYfcjWFks5tVevMgaJpZM4SHTyT .

boyofgreen commented 6 years ago

Hi @devunion someone should be jumping in shortly. We were not able to re-create, so we have a few additional questions.

tomayac commented 6 years ago

My extension contained a (naturally big) node_modules folder that was needed only for the development phase (linting, etc.). I removed this folder manually from the to-be-packaged extension folder and it worked. Looks like the "CloudAppX" service should contain a check regarding packaging size or warn about (or plain refuse to) package a node_modules folder. CC: @boyofgreen

boyofgreen commented 6 years ago

Thanks for letting me know. We've been fighting this issue where some seemingly "random" sites fail generation. We will look at file size and see if that might be the key.

boyofgreen commented 6 years ago

@michael-hawker lets discuss and see if we can carve out some of your time to look at this issue. Maybe we need to not ship all the dev components when we do the appx

tomayac commented 6 years ago

@boyofgreen @michael-hawker Any update on this? I am able to reproduce this 100% of the times :-/ on ManifoldJS 0.7.6.

$ manifoldjs -l debug -p edgeextension package SWDetector/edgeextension/manifest
[debug] manifoldjs  : Loading platform module: manifoldjs-edgeextension
[debug] manifoldjs  : Packaging the 'Microsoft Edge Extension Platform' app...
[info ] edgeextension: Packaging the Microsoft Edge Extension Platform app...
[debug] manifoldjs  : Unable to create the package locally. Invoking the CloudAppX service instead...
[debug] manifoldjs  : Invoking the CloudAppX service...
[error] manifoldjs  : Failed to package the Microsoft Edge Extension Platform app.
                          at /usr/local/lib/node_modules/manifoldjs/node_modules/manifoldjs-lib/lib/projectBuilder.js:140:29
                          at _rejected (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:864:24)
                          at /usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:890:30
                          at Promise.when (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:1142:31)
                          at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:808:41)
                          at /usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:624:44
                          at runSingle (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:137:13)
                          at flush (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:125:13)
                          at process._tickCallback (internal/process/next_tick.js:61:11)
                      Failed to create the package. The CloudAppX service returned an error - Internal Server Error (500): There was an error generating the APPX package.
                          at Request._callback (/usr/local/lib/node_modules/manifoldjs/node_modules/manifoldjs-edgeextension/lib/appPackage.js:72:32)
                          at Request.self.callback (/usr/local/lib/node_modules/manifoldjs/node_modules/request/request.js:185:22)
                          at Request.emit (events.js:182:13)
                          at Request.<anonymous> (/usr/local/lib/node_modules/manifoldjs/node_modules/request/request.js:1161:10)
                          at Request.emit (events.js:182:13)
                          at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/manifoldjs/node_modules/request/request.js:1083:12)
                          at Object.onceWrapper (events.js:273:13)
                          at IncomingMessage.emit (events.js:187:15)
                          at endReadableNT (_stream_readable.js:1081:12)
                          at process._tickCallback (internal/process/next_tick.js:63:19)
[error] manifoldjs  : One or more platforms could not be generated successfully.
                          at /usr/local/lib/node_modules/manifoldjs/node_modules/manifoldjs-lib/lib/projectBuilder.js:28:23
                          at _fulfilled (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:854:54)
                          at /usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:883:30
                          at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:816:13)
                          at /usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:624:44
                          at runSingle (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:137:13)
                          at flush (/usr/local/lib/node_modules/manifoldjs/node_modules/q/q.js:125:13)
                          at process._tickCallback (internal/process/next_tick.js:61:11)
dylanlrrb commented 6 years ago

I am also seeing this exact same error 100% of the time - has there been any update on this?

thomasingalls commented 6 years ago

I am also seeing this since Friday, cannot build.

boyofgreen commented 6 years ago

Hi Folks, we are looking at this. Hey @thomasingalls , @dylanlrrb or @tomayac can you try preview.pwabuilder.com and see if that works for you? I think I might have a redis cache that is full somewhere. Also what part of the world are you in ?

dylanlrrb commented 6 years ago

@boyofgreen I'm in the San Francisco bay area.

dmitry-trushin commented 6 years ago

@boyofgreen I have a similar problem. I'm based in Russia.

tomayac commented 6 years ago

@boyofgreen When I try pwabuilder v2.3.0 (i.e., simply replacing manifoldjs in the command with pwabuilder), this is what I get:

$ pwabuilder -l debug -p edgeextension package SWDetector/edgeextension/manifest/
[debug] pwabuilder  : Available platforms within project:
[debug] pwabuilder  : Packaging the following platforms:

FWIW, I'm based out of Hamburg, Germany.

running-codebase commented 6 years ago

@boyofgreen I am also experiencing this issue in Melbourne, Australia.

TrLucas commented 6 years ago

@boyofgreen We also experience this while attempting to build Adblock Plus for Edge.

Using pwabuilder for packaging, instead of ManifoldJS yields the same result as for @tomayac :

[debug] pwabuilder  : Available platforms within project: 
[debug] pwabuilder  : Packaging the following platforms: 

Tried both ManifoldJS and pwabuilder packaging from several locations across germany.

dylanlrrb commented 6 years ago

@boyofgreen Just an update - any attempts I make at packaging the app with preview.pwabuilder.com fails with this error in the console:

D:\home\site\wwwroot\node_modules\axios\lib\adapters\xhr.js:178 POST https://manifold-api-prod-staging.azurewebsites.net/manifests/0a01ac98/appx 500 (Internal Server Error)

boyofgreen commented 6 years ago

Hi Guys, the APPX server is back up. It should be working for everyone except for @tomayac where we still have the file size issue (addressing in sept)

TrLucas commented 6 years ago

@boyofgreen thanks for the update! A minimal setup (which used to fail too) is working again, however the full setup still fails:

[error] manifoldjs  : Failed to package the Microsoft Edge Extension Platform app.
                      Failed to create the package. The CloudAppX service returned an error - Internal Server Error (500): APPX package generation failed. Error: Command failed: 
[error] manifoldjs  : One or more platforms could not be generated successfully.
                      For more information, run manifoldjs with the diagnostics level set to debug (e.g. manifoldjs [...] -l debug)

Could you clarify the size limits? Maybe that's a problem for us too.

@tomayac for comparison, could you tell me what size your tree is pre-packaging?

Thanks in advance!

tomayac commented 6 years ago

Wowza, it just worked for me. My manifest folder weighs just 879 KB. I had size issues before, when (more or less accidentally) I tried to package the node_modules folder on top, which was only needed during development.

THeflinKeeper commented 6 years ago

Hello all, I'm getting the The CloudAppX service returned an error - Internal Server Error (500) error. Is the server down again?

danmofo commented 5 years ago

Started seeing this a few days ago, cannot build.

Edit (14/09/2018): seems to be working again.

snoack commented 5 years ago

I can confirm, about a month ago it worked again with extensions that were smaller than about 1MB. Now, it seems to fail again regardless of the size.

FWIW, for us (@adblockplus), it doesn't make much of a difference, as we couldn't build our extension for Microsoft Edge anymore since this issue first came up due to our size of >1MB.

tregagnon commented 5 years ago

Same issue here @Dashlane, we always get the error 500 from the CloudAppX service. It was working last week. (with an extension larger than 1MB)

geoffdutton commented 5 years ago

I'm getting this issue as well. Haven't seen it before today.

Edit: It seems to be back up as of today (2018-10-01).

djacobow commented 5 years ago

Getting this right now. The last time I built the same extension, about two weeks ago, no problem. Today, no dice. In the USA.

I just tried this again with the exact same folder/contents as I did last month and it failed. So something is definitely amiss with the CloudAppX, it seems.

snoack commented 5 years ago

For reference, eventually it turned out that for us (@adblockplus) this issue was unrelated of the size of the package (unlike previously suspected), but due to translating the extension's name into Azerbajani. Any of the following workarounds caused manifoldjs to build the extension successfully:

  1. Removing the translation used in the name key in manifest.json from _locales/az/messages.json.
  2. Renaming _locales/az/ to _locales/az-latn/.
  3. Hard-coding the value of the name key in manifest.json (not translating it).

In the end, we went with option 3 due to another issue with the Windows Store, that caused the build to be rejected if you haven't registered every translation of your extension's name.