ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

v3beta7 - Error: encountered bad status code (400) - When generating resources

Open zoinkydoink opened this issue 9 years ago • 26 comments

v3 beta7 testing

Please ensure that you are on the latest version of the CLI. npm view ionic@latest version

2.2.2

What version of the CLI are you using? Output of ionic --version

3.0.0-beta7

Short description of the problem:

Getting the below error when generating resources on iOS

You need to be logged into your Ionic account in order to run the cordova:resources command.

Log into your Ionic account
If you don't have one yet, create yours by running: ionic signup

? Email: **********
? Password: *****************
✔ Collecting resource configuration and source images - done!
✔ Uploading source images to prepare for transformations - done!
⠹ Generating platform resources Error: encountered bad status code (400) for http://res.ionic.io/api/v1/transform
    at Request.cli_utils_1.createRequest.timeout.type.send.on (/Users/proj/app/node_modules/@ionic/cli-plugin-cordova/dist/lib/resources.js:159:24)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at Request._emitResponse (/Users/proj/app/node_modules/superagent/lib/node/index.js:745:10)
    at ClientRequest.<anonymous> (/Users/proj/app/node_modules/superagent/lib/node/index.js:360:10)
    at Object.onceWrapper (events.js:293:19)
    at emitOne (events.js:101:20)
    at ClientRequest.emit (events.js:191:7)
    at HTTPParser.parserOnIncomingClient (_http_client.js:522:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)

What behavior are you expecting?

Generation of resources without errors

Steps to reproduce:

  1. run ionic cordova resources on iOS

zoinkydoink avatar Apr 18 '17 11:04 zoinkydoink

I have also ran these commands AGAIN still same error


npm install -g ionic@beta
npm install --save-dev @ionic/cli-plugin-ionic-angular@beta @ionic/cli-plugin-cordova@beta

zoinkydoink avatar Apr 19 '17 03:04 zoinkydoink

if u try ionic cordova resources -i it should work, but the ionic cordova resources -s does not work for me either

zoinkydoink avatar Apr 19 '17 03:04 zoinkydoink

we got the same issue

⠹ Generating platform resources: 41 / 48 complete Error: timeout of 30000ms reached for http://res.ionic.io/api/v1/transform

orlyapps avatar Apr 19 '17 09:04 orlyapps

May be related to https://github.com/driftyco/ionic-cli/issues/2118

@zoinkydoink @orlyapps Are you using custom resources?

imhoffd avatar Apr 19 '17 15:04 imhoffd

@dwieeb I am not sure what you mean by "custom" I have a splash.png and icon.png in the resource folder and those images are made by my designer, meaning they are custom logos if that is what you mean.

Also do you know when we are to expect next beta?

zoinkydoink avatar Apr 19 '17 15:04 zoinkydoink

We dont also use any "custom" icon. Same as @zoinkydoink Workarround:

  • uninstall ionic beta
  • install stable ionic
  • call ionic resources
  • uninstall ionic
  • install stable ionic beta

😄

btw: splash.png is 2732x2732px

orlyapps avatar Apr 19 '17 15:04 orlyapps

@orlyapps what is the command to uninstall betas and how do you pick which is the ionic stable? This issue has been a show stopper for me

zoinkydoink avatar Apr 19 '17 15:04 zoinkydoink

Until yesterday I got same error when run ionic cordova resources

I could generate the icons resources successfully passing --icon to ionic cordova resources --icon command.

But I got error generating the splash resources passing --splash:

✔ Collecting resource configuration and source images - done!
✔ Uploading source images to prepare for transformations - done!
⠹ Generating platform resources Error: encountered bad status code (400) for http://res.ionic.io/api/v1/transform

But today I got a different error both with parameters --icon and --splash to ionic cordova resources command:

$ ionic cordova resources 
✔ Collecting resource configuration and source images - done!
⠸ Uploading source images to prepare for transformations HTTP Error 503: POST http://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>
	</html>

What version of the CLI are you using? Output of ionic --version 3.0.0-beta7

feliperfmarques avatar Apr 20 '17 04:04 feliperfmarques

For now I also am using the workaround like @orlyapps: @zoinkydoink Here are the commands. Follow the steps below:

npm -g uninstall ionic@beta
npm -g install ionic
ionic resources
npm -g uninstall ionic
npm -g install ionic@beta

feliperfmarques avatar Apr 20 '17 04:04 feliperfmarques

This has been fixed and beta8 will be out soon! Thank you!

imhoffd avatar Apr 21 '17 19:04 imhoffd

Change file dimensions,

project/resources/splash.png => 2208x2208 to 2732x2732

Run: ionic cordova resources

niojihye avatar Apr 22 '17 22:04 niojihye

^ Correct. For existing projects, you will need a splash image with dimensions 2732x2732. Here is the default splash image: https://raw.githubusercontent.com/driftyco/ionic2-app-base/master/resources/splash.png

New projects will have the new default splash image.

imhoffd avatar Apr 23 '17 00:04 imhoffd

@niojihy @dwieeb It's solved my problem. I have a existing v2 project and my splash had a dimension of 2208x2208. I changed splash dimensions to 2732x2732 and re-ran ionic cordova resources, everything works fine now.

feliperfmarques avatar Apr 24 '17 19:04 feliperfmarques

I've 2732x2732 dimensions in IONIC V1 project. But the problem still exists.

ahayder avatar Jul 26 '17 13:07 ahayder

@ahayder You may get the timeout on a slow connection because the image has to be fully uploaded and then transformed during the request. There's nothing we can do right now about the 30s server timeout.

imhoffd avatar Jul 26 '17 20:07 imhoffd

Be sure to don't try to send your .psd file which are often heavier than your png file. After that delete the .md5, then try again. That did the trick for me

hugoblanc avatar Aug 24 '17 18:08 hugoblanc

Had the same issue, what work for me was to reduce the image size on disk, compressed it with tinypng, went from 3mb to 900k and it work after that

ndriJK avatar Oct 04 '17 21:10 ndriJK

On ionic 3.12.0, I am getting one of the errors mentioned above: "uploading source images to prepare for transformations HTTP Error 503: POST http://res.ionic.io/api/v1/upload" etc., etc. So I must be doing something wrong, or it wasn't fixed?

solumyr avatar Oct 10 '17 11:10 solumyr

@solumyr - there was a server issue earlier. It appears to be cleared up now. Can you give this another try?

kensodemann avatar Oct 10 '17 13:10 kensodemann

Works, thanks!

solumyr avatar Oct 10 '17 14:10 solumyr