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

regression: `task create` no longer returns json output #572

Closed
andycmaj opened this issue Mar 9, 2018 · 2 comments
Assignees
Labels

Comments

@andycmaj
Copy link

@andycmaj andycmaj commented Mar 9, 2018

Expected behavior (0.10.3)

(note. 0.10.7 cli calling 0.10.3 api)

l0 --output json task create returns the task as json

root@336e7fde2181:/# l0 --version
l0 version v0.10.3
root@336e7fde2181:/#  l0 --output json task create --wait --copies 1 Development_TheChunnel_e9bbb62 Development_TheChunnel_e9bbb62_smoketest_636561778927274390 Development_TheChunnel-SmokeTest_e9bbb62.1
[
    {
        "copies": [
            {
                "details": [
                    {
                        "container_name": "smoke-tests",
                        "exit_code": 0,
                        "last_status": "PENDING",
                        "reason": ""
                    }
                ],
                "reason": "",
                "task_copy_id": "arn:aws:ecs:us-west-2:069884434102:task/02352a47-488a-42e2-ae8f-97bee8354c79"
            }
        ],
        "deploy_id": "Development_TheChunnel-SmokeTest_e9bbb62.1",
        "deploy_name": "Development_TheChunnel-SmokeTest_e9bbb62",
        "deploy_version": "1",
        "desired_count": 1,
        "environment_id": "Develop009a8",
        "environment_name": "Development_TheChunnel_e9bbb62",
        "pending_count": 1,
        "running_count": 0,
        "task_id": "Develop84d4d",
        "task_name": "Development_TheChunnel_e9bbb62_smoketest_636561778927274390"
    }
]

Actual behavior (0.10.7)

the command seems to return an empty json arrray in 0.10.7

$ docker run -it -e "LAYER0_API_ENDPOINT=https://l0-***-api-****.us-west-2.elb.amazonaws.com" -e "LAYER0_AUTH_TOKEN=***" -e "LAYER0_SKIP_SSL_VERIFY=1" --entrypoint bash d.ims.io/ci-agents/mono-dotnet-cake-l0-terraform-nodejs-agent:v1.8

#### IN DOCKER
root@02876ef0f477:/# l0 --output json task create --wait --copies 1 Development_TheChunnel_e9bbb62 Development_TheChunnel_e9bbb62_smoketest_636561778927274390 Development_TheChunnel-SmokeTest_e9bbb62.1
[]
root@02876ef0f477:/# l0
NAME:
   l0 - Manage Layer0

USAGE:
   l0 [global options] command [command options] [arguments...]

VERSION:
   v0.10.7

COMMANDS:
     admin         manage the layer0 api
     deploy        manage layer0 deploys
     environment   manage layer0 environments
     job           manage layer0 jobs
     loadbalancer  manage layer0 load balancers
     service       manage layer0 services
     task          manage layer0 tasks
     help, h       show help for a command or subcommand

GLOBAL OPTIONS:
   -o value, --output value   output format [text,json] (default: "text")
   -t value, --timeout value  timeout [h,m,s,ms] (default: "15m")
   -d, --debug                Print debug statements
   --version, -v              print the version

root@02876ef0f477:/# l0 --output json --debug task create --wait --copies 1 Development_TheChunnel_e9bbb62 Development_TheChunnel_e9bbb62_smoketest_636561778927274390 Development_TheChunnel-SmokeTest_e9bbb62.1
DEBU[0000] Sent: GET https://l0-dev010r3-api-1057422203.us-west-2.elb.amazonaws.com/tag?fuzz=Development_TheChunnel_e9bbb62&type=environment

DEBU[0000] Received: 200 OK [
  {
   "entity_id": "Develop009a8",
   "entity_type": "environment",
   "tags": [
    {
     "entity_id": "Develop009a8",
     "entity_type": "environment",
     "key": "os",
     "value": "linux"
    },
    {
     "entity_id": "Develop009a8",
     "entity_type": "environment",
     "key": "name",
     "value": "Development_TheChunnel_e9bbb62"
    }
   ]
  }
 ]

DEBU[0000] Sent: GET https://l0-dev010r3-api-1057422203.us-west-2.elb.amazonaws.com/tag?fuzz=Development_TheChunnel-SmokeTest_e9bbb62.1&type=deploy

DEBU[0001] Received: 200 OK [
  {
   "entity_id": "Development_TheChunnel-SmokeTest_e9bbb62.1",
   "entity_type": "deploy",
   "tags": [
    {
     "entity_id": "Development_TheChunnel-SmokeTest_e9bbb62.1",
     "entity_type": "deploy",
     "key": "name",
     "value": "Development_TheChunnel-SmokeTest_e9bbb62"
    },
    {
     "entity_id": "Development_TheChunnel-SmokeTest_e9bbb62.1",
     "entity_type": "deploy",
     "key": "version",
     "value": "1"
    }
   ]
  }
 ]

DEBU[0001] Sent: POST https://l0-dev010r3-api-1057422203.us-west-2.elb.amazonaws.com/task/ {"container_overrides":[],"deploy_id":"Development_TheChunnel-SmokeTest_e9bbb62.1","environment_id":"Develop009a8","task_name":"Development_TheChunnel_e9bbb62_smoketest_636561778927274390"}


DEBU[0001] Received: 202 Accepted ""

DEBU[0001] Sent: GET https://l0-dev010r3-api-1057422203.us-west-2.elb.amazonaws.com/job/b8054f005782

DEBU[0001] Received: 200 OK {
  "job_id": "b8054f005782",
  "task_id": "b8054f019eaf",
  "job_status": 1,
  "job_type": 5,
  "request": "{\"container_overrides\":[],\"copies\":0,\"deploy_id\":\"Development_TheChunnel-SmokeTest_e9bbb62.1\",\"environment_id\":\"Develop009a8\",\"task_name\":\"Development_TheChunnel_e9bbb62_smoketest_636561778927274390\"}",
  "time_created": "2018-03-09T07:43:25.302398305Z",
  "meta": null
 }

DEBU[0001] Wait WaitForJob iteration 1 of 0
DEBU[0006] Sent: GET https://l0-dev010r3-api-1057422203.us-west-2.elb.amazonaws.com/job/b8054f005782

DEBU[0006] Received: 200 OK {
  "job_id": "b8054f005782",
  "task_id": "b8054f019eaf",
  "job_status": 3,
  "job_type": 5,
  "request": "{\"container_overrides\":[],\"copies\":0,\"deploy_id\":\"Development_TheChunnel-SmokeTest_e9bbb62.1\",\"environment_id\":\"Develop009a8\",\"task_name\":\"Development_TheChunnel_e9bbb62_smoketest_636561778927274390\"}",
  "time_created": "2018-03-09T07:43:25.302398305Z",
  "meta": null
 }

DEBU[0006] Sent: GET https://l0-dev010r3-api-1057422203.us-west-2.elb.amazonaws.com/job/b8054f005782

DEBU[0006] Received: 200 OK {
  "job_id": "b8054f005782",
  "task_id": "b8054f019eaf",
  "job_status": 3,
  "job_type": 5,
  "request": "{\"container_overrides\":[],\"copies\":0,\"deploy_id\":\"Development_TheChunnel-SmokeTest_e9bbb62.1\",\"environment_id\":\"Develop009a8\",\"task_name\":\"Development_TheChunnel_e9bbb62_smoketest_636561778927274390\"}",
  "time_created": "2018-03-09T07:43:25.302398305Z",
  "meta": null
 }

[] #<======== Problem

Steps to reproduce the behavior

$ docker run -it -e "LAYER0_API_ENDPOINT=https://l0-***-api-****.us-west-2.elb.amazonaws.com" -e "LAYER0_AUTH_TOKEN=***" -e "LAYER0_SKIP_SSL_VERIFY=1" --entrypoint bash d.ims.io/ci-agents/mono-dotnet-cake-l0-terraform-nodejs-agent:v1.8

#### IN DOCKER
root@02876ef0f477:/# l0 --output json task create --wait --copies 1 Development_TheChunnel_e9bbb62 Development_TheChunnel_e9bbb62_smoketest_636561778927274390 Development_TheChunnel-SmokeTest_e9bbb62.1
[]
  • l0 admin version and l0 --version
root@ad5f671b32a9:/# l0 admin version
v0.10.3
root@ad5f671b32a9:/# l0 version
No help topic for 'version'
root@ad5f671b32a9:/# l0 --version
l0 version v0.10.7
root@ad5f671b32a9:/#
@andycmaj

This comment has been minimized.

Copy link
Author

@andycmaj andycmaj commented Mar 9, 2018

also repros with 0.10.5 cli

@tlake tlake self-assigned this Mar 9, 2018
@tlake tlake added the wontfix label Mar 12, 2018
@tlake

This comment has been minimized.

Copy link
Member

@tlake tlake commented Mar 12, 2018

There was a breaking change when Layer0 v0.10.4 was released with regard to how tasks were handled; we moved away from using task names to using task ARNs, for more specificity and reliability. When we did so, we should have released a new minor version, not just a patch, since this was a breaking change.

As such, I'll be adding some known-issue-style documentation recommending that users treat v0.10.4+ as incompatible with v0.10.3-. Versions <= 0.10.3 may be considered intercompatible, and versions >= 0.10.4 may be considered intercompatible, but the gulf between the two versions is a pit of incompatibility.

@tlake tlake closed this Mar 12, 2018
@tlake tlake referenced this issue Mar 12, 2018
1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.