cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 927 forks source link

[SOLVED] ibmcloud - App upload is invalid: Invalid zip archive #1398

Closed Mueslint closed 6 years ago

Mueslint commented 6 years ago

I got an error while pushing myapp on IBM Cloud for the first time, it is redundant when updating

It's a basic express server that serves a Vuejs dashboard. I had no problem deploying a plain node.js server the same way. I have a doubt on the size of the archive as it may contain node_modules/ inside which can be a reason to the excessive weight.

Command

ibmcloud app push myapp

NB: ibmcloud app equals cf

What occurred

Waiting for API to complete processing files...
Job (<JOB_ID>) failed: The app upload is invalid: Invalid zip archive

What you expected to occur

That it is correctly deployed like my previous server

CLI Version

cf version 6.37.0+a40009753.2018-05-25

CC API Endpoint Version

api endpoint: https://api.ng.bluemix.net api version: 2.92.0

CF Trace

RESPONSE: [2018-06-14T15:31:26+02:00]
HTTP/1.1 201 Created
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Length: 270
Content-Type: application/json;charset=utf-8
Date: Thu, 14 Jun 2018 13:31:26 GMT
Expires: Thu, 14 Jun 2018 13:31:26 GMT
Pragma: no-cache
Server: nginx
X-Backside-Transport: OK OK
X-Content-Type-Options: nosniff
X-Global-Transaction-Id: 76956937
{
  "entity": {
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "status": "queued"
  },
  "metadata": {
    "created_at": "2018-06-14T13:31:26Z",
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "url": "/v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e"
  }
}

REQUEST: [2018-06-14T15:31:26+02:00]
GET /v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e HTTP/1.1
Host: api.eu-de.bluemix.net
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
User-Agent: cf/6.34.1+bbdf81482.2018-01-17 (go1.9.2; amd64 darwin)

 76.49 MiB / 76.49 MiB [===================================================================================================================================================================================] 100.00%RESPONSE: [2018-06-14T15:31:26+02:00]
HTTP/1.1 200 OK
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Length: 270
Content-Type: application/json;charset=utf-8
Date: Thu, 14 Jun 2018 13:31:26 GMT
Expires: Thu, 14 Jun 2018 13:31:26 GMT
Pragma: no-cache
Server: nginx
X-Backside-Transport: OK OK
X-Content-Type-Options: nosniff
X-Global-Transaction-Id: 107396323
{
  "entity": {
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "status": "queued"
  },
  "metadata": {
    "created_at": "2018-06-14T13:31:26Z",
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "url": "/v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e"
  }
}

 76.49 MiB / 76.49 MiB [===============================================================================================================================================================================] 100.00% 11s

Waiting for API to complete processing files...
REQUEST: [2018-06-14T15:31:29+02:00]
GET /v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e HTTP/1.1
Host: api.eu-de.bluemix.net
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
User-Agent: cf/6.34.1+bbdf81482.2018-01-17 (go1.9.2; amd64 darwin)

RESPONSE: [2018-06-14T15:31:29+02:00]
HTTP/1.1 200 OK
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Length: 271
Content-Type: application/json;charset=utf-8
Date: Thu, 14 Jun 2018 13:31:29 GMT
Expires: Thu, 14 Jun 2018 13:31:29 GMT
Pragma: no-cache
Server: nginx
X-Backside-Transport: OK OK
X-Content-Type-Options: nosniff
X-Global-Transaction-Id: 624581831
{
  "entity": {
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "status": "running"
  },
  "metadata": {
    "created_at": "2018-06-14T13:31:26Z",
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "url": "/v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e"
  }
}

REQUEST: [2018-06-14T15:31:32+02:00]
GET /v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e HTTP/1.1
Host: api.eu-de.bluemix.net
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
User-Agent: cf/6.34.1+bbdf81482.2018-01-17 (go1.9.2; amd64 darwin)

RESPONSE: [2018-06-14T15:31:32+02:00]
HTTP/1.1 200 OK
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Length: 271
Content-Type: application/json;charset=utf-8
Date: Thu, 14 Jun 2018 13:31:32 GMT
Expires: Thu, 14 Jun 2018 13:31:32 GMT
Pragma: no-cache
Server: nginx
X-Backside-Transport: OK OK
X-Content-Type-Options: nosniff
X-Global-Transaction-Id: 665559071
{
  "entity": {
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "status": "running"
  },
  "metadata": {
    "created_at": "2018-06-14T13:31:26Z",
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "url": "/v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e"
  }
}

REQUEST: [2018-06-14T15:31:35+02:00]
GET /v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e HTTP/1.1
Host: api.eu-de.bluemix.net
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
User-Agent: cf/6.34.1+bbdf81482.2018-01-17 (go1.9.2; amd64 darwin)

RESPONSE: [2018-06-14T15:31:35+02:00]
HTTP/1.1 200 OK
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Length: 524
Content-Type: application/json;charset=utf-8
Date: Thu, 14 Jun 2018 13:31:35 GMT
Expires: Thu, 14 Jun 2018 13:31:35 GMT
Pragma: no-cache
Server: nginx
X-Backside-Transport: OK OK
X-Content-Type-Options: nosniff
X-Global-Transaction-Id: 81773745
{
  "entity": {
    "error": "Use of entity>error is deprecated in favor of entity>error_details.",
    "error_details": {
      "code": 160001,
      "description": "The app upload is invalid: Invalid zip archive.",
      "error_code": "CF-AppBitsUploadInvalid"
    },
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "status": "failed"
  },
  "metadata": {
    "created_at": "2018-06-14T13:31:26Z",
    "guid": "d242b0f8-4f17-4487-b47e-9f768b13573e",
    "url": "/v2/jobs/d242b0f8-4f17-4487-b47e-9f768b13573e"
  }
}

Job (d242b0f8-4f17-4487-b47e-9f768b13573e) failed: The app upload is invalid: Invalid zip archive.
ECHEC

Platform & Shell Details

Mac OS X 10.13

Any other relevant information

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/158360221

The labels on this github issue will be updated when the story is started.

Mueslint commented 6 years ago

Solved by simply deleting node_modules/ before pushing.

Maybe you can change or add a new warning, as "invalid zip archive" gives no clues on the real issue if you're not at ease with cloudfoundry pushing process

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/158366046

The labels on this github issue will be updated when the story is started.

trabetti commented 5 years ago

I had same issue pushing a python app. Since I did not know what are node_modules/ it took me some time to understand I need to remove the venv directory. After doing this, I had to delete the app from IBM Cloud and push again. The Pivotal Tracker issue do not give any details. I think the push should handle the existence of a local venv directory, otherwise it makes things very hard for developers.

nejeoui commented 3 years ago

i have the same issue pushing a Java Liberty App 21.08 MiB / 21.08 MiB 100.00%The app is invalid: Invalid application source code found FAILED

Finished: FAILED