cloudfoundry-attic/Diego-Enabler

Getting "Error: unexpected end of JSON input" when enabling diego

Amit-PivotalLabs opened this issue · 9 comments

$ cf enable-diego g
Setting g Diego support to true
FAILED
Error: unexpected end of JSON input
{
   "metadata": {
      "guid": "76cd901b-5c86-4c14-926c-6fdcfd3f02ae",
      "url": "/v2/apps/76cd901b-5c86-4c14-926c-6fdcfd3f02ae",
      "created_at": "2016-07-12T19:09:51Z",
      "updated_at": "2016-07-12T19:15:17Z"
   },
   "entity": {
      "name": "g",
      "production": false,
      "space_guid": "58c3829a-a44f-4544-a255-f3214157d6b1",
      "stack_guid": "9942a914-981c-465a-9af4-e51eb6385ff1",
      "buildpack": "go_buildpack",
      "detected_buildpack": null,
      "environment_json": {},
      "memory": 64,
      "instances": 2,
      "disk_quota": 64,
      "state": "STOPPED",
      "version": "053defe0-5e7a-4a06-bbaf-6e4392bf80d2",
      "command": null,
      "console": false,
      "debug": null,
      "staging_task_id": "22241a2157034c528c7c46e055c2fe7c",
      "package_state": "PENDING",
      "health_check_type": "port",
      "health_check_timeout": null,
      "staging_failed_reason": null,
      "staging_failed_description": null,
      "diego": true,
      "docker_image": null,
      "package_updated_at": "2016-07-12T19:10:40Z",
      "detected_start_command": "",
      "enable_ssh": true,
      "docker_credentials_json": {
         "redacted_message": "[PRIVATE DATA HIDDEN]"
      },
      "ports": [
         8080
      ],
      "space_url": "/v2/spaces/58c3829a-a44f-4544-a255-f3214157d6b1",
      "stack_url": "/v2/stacks/9942a914-981c-465a-9af4-e51eb6385ff1",
      "routes_url": "/v2/apps/76cd901b-5c86-4c14-926c-6fdcfd3f02ae/routes",
      "events_url": "/v2/apps/76cd901b-5c86-4c14-926c-6fdcfd3f02ae/events",
      "service_bindings_url": "/v2/apps/76cd901b-5c86-4c14-926c-6fdcfd3f02ae/service_bindings",
      "route_mappings_url": "/v2/apps/76cd901b-5c86-4c14-926c-6fdcfd3f02ae/route_mappings"
   }
}

$ cf -v
cf version 6.20.0+25b1961-2016-06-29

$ cf plugins
Listing Installed Plugins...
OK

Plugin Name     Version   Command Name        Command Help
Diego-Enabler   1.2.0     enable-diego        Migrate app to the Diego runtime
Diego-Enabler   1.2.0     disable-diego       Migrate app to the DEA runtime
Diego-Enabler   1.2.0     has-diego-enabled   Report whether an app is configured to run on the Diego runtime
Diego-Enabler   1.2.0     diego-apps          Lists all apps running on the Diego runtime that are visible to the user
Diego-Enabler   1.2.0     dea-apps            Lists all apps running on the DEA runtime that are visible to the user
Diego-Enabler   1.2.0     migrate-apps        Migrate all apps to Diego/DEA

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

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

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

n4wei commented

@challiwill and I just saw a similar error when poking around with the blue-green-deploy plugin while investigating this issue cloudfoundry/cli#889 . Specifically when it makes a call to CliCommandWithoutTerminalOutput() here.

I faced the same issue during errand job which pushing app to diego with cf enable-diego APP in errand script:

Setting logs Diego support to true
Error:  unexpected end of JSON input
{
   "metadata": {
      "guid": "47ac6fab-ebdc-4807-8f1f-6d74d8baf46a",
      "url": "/v2/apps/47ac6fab-ebdc-4807-8f1f-6d74d8baf46a",
      "created_at": "2016-07-20T14:21:24Z",
      "updated_at": "2016-07-20T14:22:04Z"
   },
   "entity": {
      "name": "logs",
      "production": false,
      "space_guid": "61625212-84ca-4afc-87fd-7c24fd73254d",
      "stack_guid": "b0e4fe1f-3b15-4d91-8227-820011697ada",
      "buildpack": "https://github.com/cloudfoundry/binary-buildpack.git#v1.0.3",
      "detected_buildpack": null,
      "environment_json": {
         "CF_API_URI": "https://api.***.nip.io",
         "CF_SYSTEM_ORG": "admin",
         "***": "***",
         "***": "***",
         "NODE_ENV": "production",
         "REDIS_HOST": "192.168.222.105",
         "SESSION_EXPIRATION_MS": 43200000,
         "SKIP_SSL_VALIDATION": true
      },
      "memory": 512,
      "instances": 1,
      "disk_quota": 1024,
      "state": "STOPPED",
      "version": "78e44e03-4406-4616-92e4-c41ea55c3c28",
      "command": "bash -c \"\\$HOME/bin/--port \\$PORT\"",
      "console": false,
      "debug": null,
      "staging_task_id": null,
      "package_state": "PENDING",
      "health_check_type": "port",
      "health_check_timeout": 180,
      "staging_failed_reason": null,
      "staging_failed_description": null,
      "diego": true,
      "docker_image": null,
      "package_updated_at": "2016-07-20T14:22:00Z",
      "detected_start_command": "",
      "enable_ssh": true,
      "docker_credentials_json": {
         "redacted_message": "[PRIVATE DATA HIDDEN]"
      },
      "ports": [
         8080
      ],
      "space_url": "/v2/spaces/61625212-84ca-4afc-87fd-7c24fd73254d",
      "stack_url": "/v2/stacks/b0e4fe1f-3b15-4d91-8227-820011697ada",
      "routes_url": "/v2/apps/47ac6fab-ebdc-4807-8f1f-6d74d8baf46a/routes",
      "events_url": "/v2/apps/47ac6fab-ebdc-4807-8f1f-6d74d8baf46a/events",
      "service_bindings_url": "/v2/apps/47ac6fab-ebdc-4807-8f1f-6d74d8baf46a/service_bindings",
      "route_mappings_url": "/v2/apps/47ac6fab-ebdc-4807-8f1f-6d74d8baf46a/route_mappings"
   }
}

Are there any news / suggested workarounds? This breaks the acceptance tests and possibly our introduction of Diego in our system.

Edit: works fine with cf-cli v0.19.0 https://github.com/cloudfoundry/cli/releases/tag/v6.19.0

@tyyko Thanks for the extra details. So it's working consistently for you on 6.19.0 and fails consistently for you on 6.20.0 and 6.21.0?

Hello @dkoper , I confirm you it always work for me on 6.19.0 and earlier versions and always fails on 6.20.0 - 6.21.0.

Using older versions of the diego-enabler plugin did not change anything on cf-cli 6.20.0

@Infra-Red @Amit-PivotalLabs

Can you try with our edge binary if it's now working for you?
Download links are near the bottom of this section: https://github.com/cloudfoundry/cli#downloads

@dkoper The same issue with edge binary:

ubuntu@jumpbox:~/tmp$ ./cf -v
cf version 6.21.0+5f06b05-2016-08-07

ubuntu@jumpbox:~/tmp$ ./cf enable-diego dora
Setting dora Diego support to true
FAILED
Error: unexpected end of JSON input

This issue is fixed in Diego-Enabler - v.1.2.1. Thanks again for taking the time to report the issue.
https://plugins.cloudfoundry.org/

Regards,
Dies Koper
CF CLI PM