Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic cordova resources crashing (ERR_STREAM_DESTROYED) #3385

Closed
carstenbaumhoegger opened this issue Jul 24, 2018 · 23 comments · Fixed by #3429
Closed

ionic cordova resources crashing (ERR_STREAM_DESTROYED) #3385

carstenbaumhoegger opened this issue Jul 24, 2018 · 23 comments · Fixed by #3429
Labels

Comments

@carstenbaumhoegger
Copy link

Description:

When trying to generate the appropriate resources to build a project, ionic cordova resources does crash in the generation process.

Steps to Reproduce:

Call ionic cordova resources inside an Ionic 4 project.

Output:

ionic cordova resources                                                                                                                                                                      
✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✔ Uploading source images to prepare for transformations: 2 / 2 complete - done!
✖ Generating platform resources: 3 / 25 complete - failed!
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed

    at doWrite (_stream_writable.js:406:19)
    at clearBuffer (_stream_writable.js:540:7)
    at onwrite (_stream_writable.js:465:7)
    at fs.write (fs.js:2284:5)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:645:5)
⠏ Generating platform resources: 7 / 25 complete

My ionic info:

Ionic:

   ionic (Ionic CLI)          : 4.0.0-rc.11 (/usr/local/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-alpha.11
   @angular-devkit/core       : 0.7.0-rc.1
   @angular-devkit/schematics : 0.7.0-rc.1
   @angular/cli               : 6.0.8
   @ionic/ng-toolkit          : 1.0.0-rc.11
   @ionic/schematics-angular  : 1.0.0-rc.11

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0 ios 4.5.4

System:

   NodeJS : v10.4.1 (/usr/local/bin/node)
   npm    : 6.2.0
   OS     : macOS High Sierra
   Xcode  : Xcode 9.4.1 Build version 9F2000

Environment:

   ANDROID_HOME : not set
@ionitron-bot ionitron-bot bot added the triage label Jul 24, 2018
@carstenbaumhoegger carstenbaumhoegger changed the title ionic cordova resources crashing (ERR_STREAM_DESTROYED) 4.0.0-rc.11: ionic cordova resources crashing (ERR_STREAM_DESTROYED) Jul 24, 2018
@imhoffd
Copy link
Contributor

imhoffd commented Jul 24, 2018

@carstenbaumhoegger I'm guessing the resources server was just a bit flaky. Please try again. I just restarted it.

@carstenbaumhoegger
Copy link
Author

carstenbaumhoegger commented Jul 25, 2018

hey @dwieeb !

You're right, the error I mentioned was gone when I tried to generate the resources the first time!

Unfortunately the process didn't complete and hang up with 5 out of 25 generated.

ionic cordova resources
✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✔ Uploading source images to prepare for transformations: 2 / 2 complete - done!
⠼ Generating platform resources: 5 / 25 complete

I re-ran the command and now I get the same error again.

ionic cordova resources
✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✔ Uploading source images to prepare for transformations: 2 / 2 complete - done!
✖ Generating platform resources: 1 / 25 complete - failed!
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed

    at doWrite (_stream_writable.js:406:19)
    at clearBuffer (_stream_writable.js:540:7)
    at onwrite (_stream_writable.js:465:7)
    at fs.write (fs.js:2284:5)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:645:5)
⠧ Generating platform resources: 4 / 25 complete

Sometimes the process get's to 4 or 5 generated or even 10, but it never made it to generating all 25 files.

edit:
I just downgraded to CLI v3.20 and ran ionic cordova resources and this generated everything without problems!

@imhoffd
Copy link
Contributor

imhoffd commented Jul 25, 2018

@carstenbaumhoegger Well that's odd. I didn't change anything with the resource generation, and it's working fine for me. I'll keep this open, but I'm still convinced the server is fickle.

You're not behind a network proxy or anything, right?

@iamsteeve
Copy link

The same thing happens to me with the version of cli ionic 4.0.1
I did the normal installation flow of an ionic project ionic start myApp sidemenu --type=angular and without the type too.
` Generating platform resources: 2 / 18 complete - failed!
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed

at doWrite (_stream_writable.js:406:19)
at clearBuffer (_stream_writable.js:540:7)
at onwrite (_stream_writable.js:465:7)
at fs.write (internal/fs/streams.js:281:5)
at FSReqWrap.wrapper [as oncomplete] (fs.js:509:5)

`

The only interesting thing is that with the new version of ionic 4 the error appears but when I use the normal one without adding the type = angular because the error does not appear and it freezes does not advance.

The temporary solution is to downgrade to version 3

@imhoffd
Copy link
Contributor

imhoffd commented Jul 26, 2018

@iamsteeve Are you behind a network proxy?

@iamsteeve
Copy link

iamsteeve commented Jul 26, 2018

@dwieeb Not c:

@imhoffd
Copy link
Contributor

imhoffd commented Jul 26, 2018

@iamsteeve Mac OS or another operating system?

@carstenbaumhoegger @iamsteeve are you trying to generate custom images? Could you upload them here so I can try to debug with them?

@carstenbaumhoegger
Copy link
Author

carstenbaumhoegger commented Jul 26, 2018

@dwieeb I'm not behind a proxy.

I updated the CLI to v4.0.1 but it's still showing the same errors.

Here's the icon:

icon

@Holbanner
Copy link

Holbanner commented Jul 26, 2018

Having the exact same problem.
Here is my setup.

Ionic:

ionic (Ionic CLI) : 4.0.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.0
@ionic/app-scripts : 3.1.9

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 6.3.0, ios 4.5.4

System:

Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 6.1.2
NodeJS : v10.4.1 (/usr/local/bin/node)
npm : 6.1.0
OS : macOS High Sierra
Xcode : Xcode 9.3.1 Build version 9E501

@troyanskiy
Copy link

I had the same problem with 4.0.0 or 4.0.1
Ionic v 3.20.0 - OK

@ddumst
Copy link

ddumst commented Jul 26, 2018

same error here with last update on Ionic CLI

@mlynch
Copy link
Contributor

mlynch commented Jul 26, 2018

Thanks, we are aware. No ETA on a fix

@jairdeon
Copy link

jairdeon commented Jul 26, 2018

same error here with last update on Ionic CLI.

✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✔ Uploading source images to prepare for transformations: 2 / 2 complete - done!
✖ Generating platform resources: 4 / 32 complete - failed!
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed

at doWrite (_stream_writable.js:406:19)
at clearBuffer (_stream_writable.js:540:7)
at onwrite (_stream_writable.js:465:7)
at fs.write (internal/fs/streams.js:281:5)
at FSReqWrap.wrapper [as oncomplete] (fs.js:509:5)

@imhoffd imhoffd changed the title 4.0.0-rc.11: ionic cordova resources crashing (ERR_STREAM_DESTROYED) ionic cordova resources crashing (ERR_STREAM_DESTROYED) Jul 27, 2018
@imhoffd
Copy link
Contributor

imhoffd commented Jul 27, 2018

Out of curiosity, could someone try this CLI version and let me know if the error still occurs: npm i -g ionic@4.1.0-testing.458303e0

@stenioanibal
Copy link

Same error with latest Ionic CLI

@DatScreamer
Copy link

DatScreamer commented Jul 28, 2018

Had the same issue with v4.0.1 but when I ran npm i -g ionic@4.1.0-testing.458303e0 and it worked flawlessly.

@kckoerich
Copy link

kckoerich commented Jul 28, 2018

following @dwieeb & @DatScreamer tips it worked like a charm for me!

@arjha
Copy link

arjha commented Jul 28, 2018

Had same problem, but after running @DatScreamer suggested command it worked fine.

@stenioanibal
Copy link

@dwieeb This works like a charm for me!!! Thanks life saver!

@camtera
Copy link

camtera commented Jul 28, 2018

Thank you @DatScreamer, solution works above. I've had issues for past 3 days. Thank you @mlynch and ionic team for such a fabulous image generating tool.

@imhoffd
Copy link
Contributor

imhoffd commented Jul 28, 2018

Thank you all for testing the 4.1.0-testing.458303e0 version. 💪 The fix will be in 4.0.2 when this gets merged: #3429

@OmkarFatale
Copy link

I was still having this issue with ionic cli 4.12.0,

ionic cordova resources android --force
√ Collecting resource configuration and source images - done!
√ Filtering out image resources that do not need regeneration - done!
| Uploading source images to prepare for transformations
HTTP Error 503: POST https://res.ionic.io/api/v1/upload

<!DOCTYPE html>
        <html>
          <head>
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <meta charset="utf-8">
                <title>Application Error</title>
                <style media="screen">
                  html,body,iframe {
                        margin: 0;
                        padding: 0;
                  }
                  html,body {
                        height: 100%;
                        overflow: hidden;
                  }
                  iframe {
                        width: 100%;
                        height: 100%;
                        border: 0;
                  }
                </style>
          </head>
          <body>
                <iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
          </body>

so I used this NPM Cordova-Res package to generate resources

@DaveTacker
Copy link

@OmkarFatale Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.