josmo / drone-rancher

Drone plugin for triggering Rancher deployments
53 stars 35 forks source link

Failed to list rancher services? #16

Closed xtaci closed 7 years ago

xtaci commented 8 years ago

the output from my drone:

$ docker images -q -f dangling=true
[info] Pulling image plugins/drone-rancher:latest
Drone Rancher Plugin built from b4cd686
Failed to list rancher services: json: cannot unmarshal number into Go value of type string
[info] build failed (exit code 1)

rancher version: v1.1.2 drone version: 0.4

i have tried every combination of rancher plugin parameters, still could not figure out why.

plus my .drone.yml part :

 deploy:
  rancher:
    url: http://192.168.1.220:8084
    access_key: 25317F6D60E3110BC2E2
    secret_key: ryAmtmSd4WpajBc9q9JRk9KfubJEmHDjxAHFTQyw
    service: p1/agent
    docker_image: 192.168.1.220:5000/agent:latest
    timeout: 30

PS.

tried quoting access_key.

polysign commented 8 years ago

Any news on this? We ran into the same issue today and don't know how to solve/debug this.

bazilio91 commented 8 years ago

Just rebuilt plugin with fresh rancher-go and got this:

Failed to list rancher services: Failed to parse:

{"type":"collection","resourceType":"service","links":{"self":"http://192.168.2.2:8080/v1/services"},"createTypes":{"dnsService":"http://192.168.2.2:8080/v1/dnsservices","externalService":"http://192.168.2.2:8080/v1/externalservices","loadBalancerService":"http://192.168.2.2:8080/v1/loadbalancerservices","service":"http://192.168.2.2:8080/v1/services"},"actions":{},"data":[{"id":"1s3","type":"composeService","links":{"self":"http://192.168.2.2:8080/v1/composeservices/1s3","account":"http://192.168.2.2:8080/v1/composeservices/1s3/account","consumedbyservices":"http://192.168.2.2:8080/v1/composeservices/1s3/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/composeservices/1s3/consumedservices","environment":"http://192.168.2.2:8080/v1/composeservices/1s3/environment","instances":"http://192.168.2.2:8080/v1/composeservices/1s3/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/composeservices/1s3/serviceexposemaps"},"actions":{"remove":"http://192.168.2.2:8080/v1/composeservices/1s3/?action=remove"},"name":"server","state":"active","accountId":"1a5","created":"2016-08-16T09:18:06Z","createdTS":1471339086000,"currentScale":1,"description":null,"environmentId":"1e2","externalId":null,"fqdn":null,"healthState":"healthy","kind":"composeService","launchConfig":{"accountId":"1a5","createIndex":null,"created":1471339084000,"deploymentUnitUuid":null,"description":null,"externalId":"7b158fbcd13e78389e3167debf48db3c948155043947c31a1e1e4b13e0ef9d0f","firstRunning":null,"healthState":null,"hostname":"7b158fbcd13e","id":3,"kind":"container","memoryMb":null,"nativeContainer":true,"networkContainerId":null,"registryCredentialId":"1c4","removed":null,"startCount":1,"state":"starting","systemContainer":null,"userdata":null,"uuid":"da93d7c6-18f2-4623-8da1-e2c8347d2636","version":"0"},"publicEndpoints":null,"removed":null,"scale":null,"scalePolicy":null,"secondaryLaunchConfigs":[],"selectorContainer":"com.docker.compose.project=rancher, com.docker.compose.service=server","selectorLink":null,"startOnCreate":true,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"uuid":"da5b83fd-6d62-493f-b71e-1f5e94d5eab5","vip":null},{"id":"1s13","type":"composeService","links":{"self":"http://192.168.2.2:8080/v1/composeservices/1s13","account":"http://192.168.2.2:8080/v1/composeservices/1s13/account","consumedbyservices":"http://192.168.2.2:8080/v1/composeservices/1s13/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/composeservices/1s13/consumedservices","environment":"http://192.168.2.2:8080/v1/composeservices/1s13/environment","instances":"http://192.168.2.2:8080/v1/composeservices/1s13/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/composeservices/1s13/serviceexposemaps"},"actions":{"remove":"http://192.168.2.2:8080/v1/composeservices/1s13/?action=remove"},"name":"nfs","state":"active","accountId":"1a5","created":"2016-08-20T10:50:27Z","createdTS":1471690227000,"currentScale":1,"description":null,"environmentId":"1e2","externalId":null,"fqdn":null,"healthState":"healthy","kind":"composeService","launchConfig":{"accountId":"1a5","createIndex":null,"created":1471690226000,"deploymentUnitUuid":null,"description":null,"externalId":"072003342e0d1601fbadb76ce432e9530590c4869e17444ca5e3e0b8b01e9b21","firstRunning":null,"healthState":null,"hostname":"072003342e0d","id":3628,"kind":"container","memoryMb":null,"nativeContainer":true,"networkContainerId":null,"registryCredentialId":"1c4","removed":null,"startCount":1,"state":"starting","systemContainer":null,"userdata":null,"uuid":"53b3ca8c-d997-465e-95e0-a0940c3e2efc","version":"0"},"publicEndpoints":null,"removed":null,"scale":null,"scalePolicy":null,"secondaryLaunchConfigs":[],"selectorContainer":"com.docker.compose.project=rancher, com.docker.compose.service=nfs","selectorLink":null,"startOnCreate":true,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"uuid":"0cc12861-cf95-4b6d-b202-6e75f7232e8d","vip":null},{"id":"1s14","type":"service","links":{"self":"http://192.168.2.2:8080/v1/services/1s14","account":"http://192.168.2.2:8080/v1/services/1s14/account","consumedbyservices":"http://192.168.2.2:8080/v1/services/1s14/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/services/1s14/consumedservices","environment":"http://192.168.2.2:8080/v1/services/1s14/environment","instances":"http://192.168.2.2:8080/v1/services/1s14/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/services/1s14/serviceexposemaps","containerStats":"http://192.168.2.2:8080/v1/services/1s14/containerstats"},"actions":{"update":"http://192.168.2.2:8080/v1/services/1s14/?action=update","remove":"http://192.168.2.2:8080/v1/services/1s14/?action=remove","setservicelinks":"http://192.168.2.2:8080/v1/services/1s14/?action=setservicelinks","removeservicelink":"http://192.168.2.2:8080/v1/services/1s14/?action=removeservicelink","activate":"http://192.168.2.2:8080/v1/services/1s14/?action=activate","upgrade":"http://192.168.2.2:8080/v1/services/1s14/?action=upgrade","addservicelink":"http://192.168.2.2:8080/v1/services/1s14/?action=addservicelink"},"name":"convoy-nfs","state":"inactive","accountId":"1a5","assignServiceIpAddress":false,"createIndex":1,"created":"2016-08-20T10:51:33Z","createdTS":1471690293000,"currentScale":1,"description":null,"environmentId":"1e8","externalId":null,"fqdn":null,"healthState":"unhealthy","kind":"service","launchConfig":{"command":["volume-agent-nfs"],"dataVolumes":["/lib/modules:/lib/modules:ro","/proc:/host/proc","/var/run:/host/var/run","/run:/host/run","/etc/docker/plugins:/etc/docker/plugins"],"healthCheck":{"healthyThreshold":2,"interval":2000,"port":10241,"requestLine":"GET /healthcheck HTTP/1.0","responseTimeout":2000,"strategy":"recreate","unhealthyThreshold":3},"imageUuid":"docker:rancher/convoy-agent:v0.9.0","kind":"container","labels":{"io.rancher.container.create_agent":"true","io.rancher.scheduler.global":"true","io.rancher.service.hash":"0853347f691189b2c36d468c818b387a1d648c10"},"logConfig":{},"networkMode":"managed","pidMode":"host","privileged":true,"publishAllPorts":false,"readOnly":false,"startOnCreate":true,"stdinOpen":false,"tty":false,"version":"0","vcpu":1},"metadata":{"io.rancher.service.hash":"c363683913deed32308aee622fc47f622956ddb4","mount_dir":"/exports","mount_opts":"proto=tcp,port=2049,nfsvers=4","nfs_server":"192.168.2.2"},"publicEndpoints":null,"removed":null,"retainIp":null,"scale":1,"scalePolicy":null,"secondaryLaunchConfigs":[],"selectorContainer":null,"selectorLink":null,"startOnCreate":false,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"upgrade":null,"uuid":"d47fb124-c6fa-4daa-b0e0-61998e7f824a","vip":null},{"id":"1s15","type":"service","links":{"self":"http://192.168.2.2:8080/v1/services/1s15","account":"http://192.168.2.2:8080/v1/services/1s15/account","consumedbyservices":"http://192.168.2.2:8080/v1/services/1s15/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/services/1s15/consumedservices","environment":"http://192.168.2.2:8080/v1/services/1s15/environment","instances":"http://192.168.2.2:8080/v1/services/1s15/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/services/1s15/serviceexposemaps","containerStats":"http://192.168.2.2:8080/v1/services/1s15/containerstats"},"actions":{"update":"http://192.168.2.2:8080/v1/services/1s15/?action=update","restart":"http://192.168.2.2:8080/v1/services/1s15/?action=restart","remove":"http://192.168.2.2:8080/v1/services/1s15/?action=remove","setservicelinks":"http://192.168.2.2:8080/v1/services/1s15/?action=setservicelinks","removeservicelink":"http://192.168.2.2:8080/v1/services/1s15/?action=removeservicelink","upgrade":"http://192.168.2.2:8080/v1/services/1s15/?action=upgrade","addservicelink":"http://192.168.2.2:8080/v1/services/1s15/?action=addservicelink","deactivate":"http://192.168.2.2:8080/v1/services/1s15/?action=deactivate"},"name":"convoy-nfs-storagepool","state":"active","accountId":"1a5","assignServiceIpAddress":false,"createIndex":1,"created":"2016-08-20T10:51:33Z","createdTS":1471690293000,"currentScale":1,"description":null,"environmentId":"1e8","externalId":null,"fqdn":null,"healthState":"healthy","kind":"service","launchConfig":{"command":["storagepool-agent"],"dataVolumes":["/var/run:/host/var/run","/run:/host/run"],"healthCheck":{"healthyThreshold":2,"interval":2000,"port":10241,"requestLine":"GET /healthcheck HTTP/1.0","responseTimeout":2000,"strategy":"recreate","unhealthyThreshold":3},"imageUuid":"docker:rancher/convoy-agent:v0.9.0","kind":"container","labels":{"io.rancher.container.create_agent":"true","io.rancher.service.hash":"da767ee200942776441725e251ef4954f50059bf"},"logConfig":{},"networkMode":"managed","privileged":false,"publishAllPorts":false,"readOnly":false,"startOnCreate":true,"stdinOpen":false,"tty":false,"version":"0","vcpu":1},"metadata":{"io.rancher.service.hash":"1b4faaedb219620f9fdd6f45f3709fdc6a20719c","mount_dir":"/exports","nfs_server":"192.168.2.2"},"publicEndpoints":null,"removed":null,"retainIp":null,"scale":1,"scalePolicy":null,"secondaryLaunchConfigs":[],"selectorContainer":null,"selectorLink":null,"startOnCreate":false,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"upgrade":null,"uuid":"3e1aabc6-371a-4faf-9e39-e1de935834df","vip":null},{"id":"1s19","type":"service","links":{"self":"http://192.168.2.2:8080/v1/services/1s19","account":"http://192.168.2.2:8080/v1/services/1s19/account","consumedbyservices":"http://192.168.2.2:8080/v1/services/1s19/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/services/1s19/consumedservices","environment":"http://192.168.2.2:8080/v1/services/1s19/environment","instances":"http://192.168.2.2:8080/v1/services/1s19/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/services/1s19/serviceexposemaps","containerStats":"http://192.168.2.2:8080/v1/services/1s19/containerstats"},"actions":{"update":"http://192.168.2.2:8080/v1/services/1s19/?action=update","restart":"http://192.168.2.2:8080/v1/services/1s19/?action=restart","remove":"http://192.168.2.2:8080/v1/services/1s19/?action=remove","setservicelinks":"http://192.168.2.2:8080/v1/services/1s19/?action=setservicelinks","removeservicelink":"http://192.168.2.2:8080/v1/services/1s19/?action=removeservicelink","upgrade":"http://192.168.2.2:8080/v1/services/1s19/?action=upgrade","addservicelink":"http://192.168.2.2:8080/v1/services/1s19/?action=addservicelink","deactivate":"http://192.168.2.2:8080/v1/services/1s19/?action=deactivate"},"name":"web","state":"active","accountId":"1a5","assignServiceIpAddress":false,"createIndex":6,"created":"2016-08-21T09:07:56Z","createdTS":1471770476000,"currentScale":1,"description":null,"environmentId":"1e10","externalId":null,"fqdn":null,"healthState":"healthy","kind":"service","launchConfig":{"capAdd":[],"capDrop":[],"count":null,"cpuSet":null,"cpuShares":null,"dataVolumes":[],"dataVolumesFrom":[],"description":null,"devices":[],"dns":[],"dnsSearch":[],"domainName":"test.dev.onetouch.travel","environment":{"DB_HOST":"db","DB_PORT":"5432","DB_NAME":"test_onetouch_db","DB_USERNAME":"onetouch_user","DB_PASSWORD":"heinknife","API_SERVER":"http://api.onetouch.travel","API_SOAP_LOGIN":"OneTouchTravel","API_SOAP_PASSWORD":"test","API_SOAP_TRACE":"true","API_WSDL_CACHE":"0","LOCATOR_BASE_URI":"http://locations.onetouch.travel/api/v1/","LOCATOR_LOGIN":"OneTouchTravel","LOCATOR_PASSWORD":"test","DOMAIN":"test.dev.onetouch.travel","FRONTEND_MOCKS":"false","MAILER_USE_FILE_TRANSPORT":"true"},"hostname":null,"imageUuid":"docker:kossmoss/onetouch_web","kind":"container","labels":{"io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"logConfig":{"config":{},"driver":""},"memory":null,"memoryMb":null,"memorySwap":null,"networkContainerId":null,"networkMode":"managed","pidMode":null,"ports":["192.168.2.2:10080:80/tcp"],"privileged":false,"publishAllPorts":false,"readOnly":false,"requestedIpAddress":null,"startOnCreate":true,"stdinOpen":true,"tty":true,"user":null,"userdata":null,"version":"aa1af851-2849-4463-a74f-a19fc81482ef","volumeDriver":null,"workingDir":null,"dataVolumesFromLaunchConfigs":[],"networkLaunchConfig":null,"vcpu":1},"metadata":null,"publicEndpoints":[{"ipAddress":"192.168.2.2","port":10080,"serviceId":"1s19","hostId":"1h1","instanceId":"1i4296"}],"removed":null,"retainIp":null,"scale":1,"scalePolicy":null,"secondaryLaunchConfigs":[{"kind":"container","networkMode":"managed","privileged":false,"publishAllPorts":false,"readOnly":false,"startOnCreate":true,"stdinOpen":true,"tty":true,"vcpu":1,"labels":{"io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"imageUuid":"docker:postgres:9.4","ports":[],"dataVolumes":["/root/data/test_db:/var/lib/postgresql/data"],"dataVolumesFrom":[],"dns":[],"dnsSearch":[],"capAdd":[],"capDrop":[],"devices":[],"logConfig":{"driver":"","config":{}},"dataVolumesFromLaunchConfigs":[],"name":"db","environment":{"POSTGRES_USER":"onetouch_user","POSTGRES_PASSWORD":"heinknife","POSTGRES_DB":"test_onetouch_db"},"volumeDriver":null,"hostname":null,"count":null,"cpuSet":null,"cpuShares":null,"description":null,"domainName":null,"memory":null,"memoryMb":null,"memorySwap":null,"networkLaunchConfig":null,"pidMode":null,"requestedIpAddress":null,"user":null,"userdata":null,"workingDir":null,"version":"0"}],"selectorContainer":null,"selectorLink":null,"startOnCreate":true,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"upgrade":{"inServiceStrategy":{"batchSize":1,"intervalMillis":2000,"launchConfig":{"capAdd":[],"capDrop":[],"count":null,"cpuSet":null,"cpuShares":null,"dataVolumes":[],"dataVolumesFrom":[],"description":null,"devices":[],"dns":[],"dnsSearch":[],"domainName":"test.dev.onetouch.travel","environment":{"DB_HOST":"db","DB_PORT":"5432","DB_NAME":"test_onetouch_db","DB_USERNAME":"onetouch_user","DB_PASSWORD":"heinknife","API_SERVER":"http://api.onetouch.travel","API_SOAP_LOGIN":"OneTouchTravel","API_SOAP_PASSWORD":"test","API_SOAP_TRACE":"true","API_WSDL_CACHE":"0","LOCATOR_BASE_URI":"http://locations.onetouch.travel/api/v1/","LOCATOR_LOGIN":"OneTouchTravel","LOCATOR_PASSWORD":"test","DOMAIN":"test.dev.onetouch.travel","FRONTEND_MOCKS":"false","MAILER_USE_FILE_TRANSPORT":"true"},"hostname":null,"imageUuid":"docker:kossmoss/onetouch_web","kind":"container","labels":{"io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"logConfig":{"config":{},"driver":""},"memory":null,"memoryMb":null,"memorySwap":null,"networkContainerId":null,"networkMode":"managed","pidMode":null,"ports":["192.168.2.2:10080:80/tcp"],"privileged":false,"publishAllPorts":false,"readOnly":false,"requestedIpAddress":null,"startOnCreate":true,"stdinOpen":true,"tty":true,"user":null,"userdata":null,"version":"aa1af851-2849-4463-a74f-a19fc81482ef","volumeDriver":null,"workingDir":null,"dataVolumesFromLaunchConfigs":[],"networkLaunchConfig":null,"vcpu":1},"previousLaunchConfig":{"capAdd":[],"capDrop":[],"count":null,"cpuSet":null,"cpuShares":null,"dataVolumes":[],"dataVolumesFrom":[],"description":null,"devices":[],"dns":[],"dnsSearch":[],"domainName":null,"environment":{"DB_HOST":"db","DB_PORT":"5432","DB_NAME":"test_onetouch_db","DB_USERNAME":"onetouch_user","DB_PASSWORD":"heinknife","API_SERVER":"http://api.onetouch.travel","API_SOAP_LOGIN":"OneTouchTravel","API_SOAP_PASSWORD":"test","API_SOAP_TRACE":"true","API_WSDL_CACHE":"0","LOCATOR_BASE_URI":"http://locations.onetouch.travel/api/v1/","LOCATOR_LOGIN":"OneTouchTravel","LOCATOR_PASSWORD":"test","DOMAIN":"test.dev.onetouch.travel","FRONTEND_MOCKS":"false","MAILER_USE_FILE_TRANSPORT":"true"},"hostname":null,"imageUuid":"docker:kossmoss/onetouch_web","kind":"container","labels":{"io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"logConfig":{"config":{},"driver":""},"memory":null,"memoryMb":null,"memorySwap":null,"networkContainerId":null,"networkMode":"managed","pidMode":null,"ports":["192.168.2.2:10080:80/tcp"],"privileged":false,"publishAllPorts":false,"readOnly":false,"requestedIpAddress":null,"startOnCreate":true,"stdinOpen":true,"tty":true,"user":null,"userdata":null,"version":"a7db4c8f-f9e9-44ae-b314-674173a63f18","volumeDriver":null,"workingDir":null,"dataVolumesFromLaunchConfigs":[],"networkLaunchConfig":null,"vcpu":1},"previousSecondaryLaunchConfigs":[{"kind":"container","networkMode":"managed","privileged":false,"publishAllPorts":false,"readOnly":false,"startOnCreate":true,"stdinOpen":true,"tty":true,"vcpu":1,"labels":{"io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"imageUuid":"docker:postgres:9.4","ports":[],"dataVolumes":["/root/data/test_db:/var/lib/postgresql/data"],"dataVolumesFrom":[],"dns":[],"dnsSearch":[],"capAdd":[],"capDrop":[],"devices":[],"logConfig":{"driver":"","config":{}},"dataVolumesFromLaunchConfigs":[],"name":"db","environment":{"POSTGRES_USER":"onetouch_user","POSTGRES_PASSWORD":"heinknife","POSTGRES_DB":"test_onetouch_db"},"volumeDriver":null,"hostname":null,"count":null,"cpuSet":null,"cpuShares":null,"description":null,"domainName":null,"memory":null,"memoryMb":null,"memorySwap":null,"networkLaunchConfig":null,"pidMode":null,"requestedIpAddress":null,"user":null,"userdata":null,"workingDir":null,"version":"0"}],"secondaryLaunchConfigs":[],"startFirst":false},"toServiceStrategy":null},"uuid":"d4559521-dee4-46ca-8d5a-ae39f4e65dd4","vip":null},{"id":"1s20","type":"service","links":{"self":"http://192.168.2.2:8080/v1/services/1s20","account":"http://192.168.2.2:8080/v1/services/1s20/account","consumedbyservices":"http://192.168.2.2:8080/v1/services/1s20/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/services/1s20/consumedservices","environment":"http://192.168.2.2:8080/v1/services/1s20/environment","instances":"http://192.168.2.2:8080/v1/services/1s20/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/services/1s20/serviceexposemaps","containerStats":"http://192.168.2.2:8080/v1/services/1s20/containerstats"},"actions":{"update":"http://192.168.2.2:8080/v1/services/1s20/?action=update","restart":"http://192.168.2.2:8080/v1/services/1s20/?action=restart","remove":"http://192.168.2.2:8080/v1/services/1s20/?action=remove","setservicelinks":"http://192.168.2.2:8080/v1/services/1s20/?action=setservicelinks","removeservicelink":"http://192.168.2.2:8080/v1/services/1s20/?action=removeservicelink","upgrade":"http://192.168.2.2:8080/v1/services/1s20/?action=upgrade","addservicelink":"http://192.168.2.2:8080/v1/services/1s20/?action=addservicelink","deactivate":"http://192.168.2.2:8080/v1/services/1s20/?action=deactivate"},"name":"web","state":"active","accountId":"1a5","assignServiceIpAddress":false,"createIndex":4,"created":"2016-08-21T09:34:38Z","createdTS":1471772078000,"currentScale":1,"description":null,"environmentId":"1e11","externalId":null,"fqdn":null,"healthState":"healthy","kind":"service","launchConfig":{"capAdd":[],"capDrop":[],"count":null,"cpuSet":null,"cpuShares":null,"dataVolumes":[],"dataVolumesFrom":[],"description":null,"devices":[],"dns":[],"dnsSearch":[],"domainName":null,"environment":{"API_SERVER":"http://api.onetouch.travel","API_SOAP_LOGIN":"OneTouchTravel","API_SOAP_PASSWORD":"test","API_SOAP_TRACE":"true","API_WSDL_CACHE":"0","DB_HOST":"db","DB_NAME":"stage_onetouch_db","DB_PASSWORD":"heinknife","DB_PORT":"5432","DB_USERNAME":"onetouch_user","DOMAIN":"test.dev.onetouch.travel","FRONTEND_MOCKS":"false","LOCATOR_BASE_URI":"http://locations.onetouch.travel/api/v1/","LOCATOR_LOGIN":"OneTouchTravel","LOCATOR_PASSWORD":"test","MAILER_USE_FILE_TRANSPORT":"true"},"hostname":null,"imageUuid":"docker:kossmoss/onetouch_web:latest","kind":"container","labels":{"io.rancher.sidekicks":"db","io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"logConfig":{"config":{},"driver":""},"memory":null,"memoryMb":null,"memorySwap":null,"networkMode":"managed","pidMode":null,"ports":["11080:80/tcp"],"privileged":false,"publishAllPorts":false,"readOnly":false,"requestedIpAddress":null,"startOnCreate":true,"stdinOpen":true,"tty":true,"user":null,"userdata":null,"version":"164cd27a-e9b5-480a-9761-c01c83c83d1a","volumeDriver":null,"workingDir":null,"dataVolumesFromLaunchConfigs":[],"networkLaunchConfig":null,"vcpu":1},"metadata":{"io.rancher.service.hash":"3c601fae6487987ab4d4cde66f483bca3c1da255"},"publicEndpoints":[{"ipAddress":"192.168.2.2","port":11080,"serviceId":"1s20","hostId":"1h1","instanceId":"1i4297"}],"removed":null,"retainIp":null,"scale":1,"scalePolicy":null,"secondaryLaunchConfigs":[{"dataVolumes":["/root/data/stage_db:/var/lib/postgresql/data"],"environment":{"POSTGRES_DB":"stage_onetouch_db","POSTGRES_PASSWORD":"heinknife","POSTGRES_USER":"onetouch_user"},"imageUuid":"docker:postgres:9.4","labels":{"io.rancher.container.hostname_override":"container_name","io.rancher.container.pull_image":"always","io.rancher.service.hash":"2a07775a213be20ea865d53fc5e7b9d7fc3a4d77"},"logConfig":{},"name":"db","networkMode":"managed","startOnCreate":true,"stdinOpen":true,"tty":true,"kind":"container","privileged":false,"publishAllPorts":false,"readOnly":false,"vcpu":1,"version":"0"}],"selectorContainer":null,"selectorLink":null,"startOnCreate":false,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"upgrade":{"inServiceStrategy":{"batchSize":1,"intervalMillis":2000,"launchConfig":{"capAdd":[],"capDrop":[],"count":null,"cpuSet":null,"cpuShares":null,"dataVolumes":[],"dataVolumesFrom":[],"description":null,"devices":[],"dns":[],"dnsSearch":[],"domainName":null,"environment":{"API_SERVER":"http://api.onetouch.travel","API_SOAP_LOGIN":"OneTouchTravel","API_SOAP_PASSWORD":"test","API_SOAP_TRACE":"true","API_WSDL_CACHE":"0","DB_HOST":"db","DB_NAME":"stage_onetouch_db","DB_PASSWORD":"heinknife","DB_PORT":"5432","DB_USERNAME":"onetouch_user","DOMAIN":"test.dev.onetouch.travel","FRONTEND_MOCKS":"false","LOCATOR_BASE_URI":"http://locations.onetouch.travel/api/v1/","LOCATOR_LOGIN":"OneTouchTravel","LOCATOR_PASSWORD":"test","MAILER_USE_FILE_TRANSPORT":"true"},"hostname":null,"imageUuid":"docker:kossmoss/onetouch_web:latest","kind":"container","labels":{"io.rancher.sidekicks":"db","io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"logConfig":{"config":{},"driver":""},"memory":null,"memoryMb":null,"memorySwap":null,"networkMode":"managed","pidMode":null,"ports":["11080:80/tcp"],"privileged":false,"publishAllPorts":false,"readOnly":false,"requestedIpAddress":null,"startOnCreate":true,"stdinOpen":true,"tty":true,"user":null,"userdata":null,"version":"164cd27a-e9b5-480a-9761-c01c83c83d1a","volumeDriver":null,"workingDir":null,"dataVolumesFromLaunchConfigs":[],"networkLaunchConfig":null,"vcpu":1},"previousLaunchConfig":{"capAdd":[],"capDrop":[],"count":null,"cpuSet":null,"cpuShares":null,"dataVolumes":[],"dataVolumesFrom":[],"description":null,"devices":[],"dns":[],"dnsSearch":[],"domainName":null,"environment":{"API_SERVER":"http://api.onetouch.travel","API_SOAP_LOGIN":"OneTouchTravel","API_SOAP_PASSWORD":"test","API_SOAP_TRACE":"true","API_WSDL_CACHE":"0","DB_HOST":"db","DB_NAME":"stage_onetouch_db","DB_PASSWORD":"heinknife","DB_PORT":"5432","DB_USERNAME":"onetouch_user","DOMAIN":"test.dev.onetouch.travel","FRONTEND_MOCKS":"false","LOCATOR_BASE_URI":"http://locations.onetouch.travel/api/v1/","LOCATOR_LOGIN":"OneTouchTravel","LOCATOR_PASSWORD":"test","MAILER_USE_FILE_TRANSPORT":"true"},"hostname":null,"imageUuid":"docker:kossmoss/onetouch_web:latest","kind":"container","labels":{"io.rancher.sidekicks":"db","io.rancher.container.pull_image":"always","io.rancher.container.hostname_override":"container_name"},"logConfig":{"config":{},"driver":""},"memory":null,"memoryMb":null,"memorySwap":null,"networkMode":"managed","pidMode":null,"ports":["11080:80/tcp"],"privileged":false,"publishAllPorts":false,"readOnly":false,"requestedIpAddress":null,"startOnCreate":true,"stdinOpen":true,"tty":true,"user":null,"userdata":null,"version":"f47ab8f0-59b3-4328-b11a-6fc04288afae","volumeDriver":null,"workingDir":null,"dataVolumesFromLaunchConfigs":[],"networkLaunchConfig":null,"vcpu":1},"previousSecondaryLaunchConfigs":[{"dataVolumes":["/root/data/stage_db:/var/lib/postgresql/data"],"environment":{"POSTGRES_DB":"stage_onetouch_db","POSTGRES_PASSWORD":"heinknife","POSTGRES_USER":"onetouch_user"},"imageUuid":"docker:postgres:9.4","labels":{"io.rancher.container.hostname_override":"container_name","io.rancher.container.pull_image":"always","io.rancher.service.hash":"2a07775a213be20ea865d53fc5e7b9d7fc3a4d77"},"logConfig":{},"name":"db","networkMode":"managed","startOnCreate":true,"stdinOpen":true,"tty":true,"kind":"container","privileged":false,"publishAllPorts":false,"readOnly":false,"vcpu":1,"version":"0"}],"secondaryLaunchConfigs":[],"startFirst":false},"toServiceStrategy":null},"uuid":"7045f5b1-2593-41bf-9527-f4d386e8430b","vip":null},{"id":"1s21","type":"service","links":{"self":"http://192.168.2.2:8080/v1/services/1s21","account":"http://192.168.2.2:8080/v1/services/1s21/account","consumedbyservices":"http://192.168.2.2:8080/v1/services/1s21/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/services/1s21/consumedservices","environment":"http://192.168.2.2:8080/v1/services/1s21/environment","instances":"http://192.168.2.2:8080/v1/services/1s21/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/services/1s21/serviceexposemaps","containerStats":"http://192.168.2.2:8080/v1/services/1s21/containerstats"},"actions":{"update":"http://192.168.2.2:8080/v1/services/1s21/?action=update","remove":"http://192.168.2.2:8080/v1/services/1s21/?action=remove","setservicelinks":"http://192.168.2.2:8080/v1/services/1s21/?action=setservicelinks","removeservicelink":"http://192.168.2.2:8080/v1/services/1s21/?action=removeservicelink","activate":"http://192.168.2.2:8080/v1/services/1s21/?action=activate","upgrade":"http://192.168.2.2:8080/v1/services/1s21/?action=upgrade","addservicelink":"http://192.168.2.2:8080/v1/services/1s21/?action=addservicelink"},"name":"cleanup","state":"inactive","accountId":"1a5","assignServiceIpAddress":false,"createIndex":1,"created":"2016-08-21T09:52:40Z","createdTS":1471773160000,"currentScale":1,"description":null,"environmentId":"1e12","externalId":null,"fqdn":null,"healthState":"unhealthy","kind":"service","launchConfig":{"dataVolumes":["/var/run/docker.sock:/var/run/docker.sock","/var/lib/docker:/var/lib/docker"],"environment":{"CLEAN_PERIOD":"3600","DEBUG":"0","DELAY_TIME":"900","KEEP_CONTAINERS":"*:*","KEEP_IMAGES":"rancher/,drone/,*:test","LOOP":"true"},"imageUuid":"docker:meltwater/docker-cleanup:1.6.0","kind":"container","labels":{"io.rancher.scheduler.affinity:host_label_ne":"janitor.exclude=true","io.rancher.scheduler.global":"true","io.rancher.service.hash":"0e9e0744662c17f5c0785c1f275de60358ab5eb5"},"logConfig":{},"networkMode":"none","privileged":false,"publishAllPorts":false,"readOnly":false,"startOnCreate":true,"stdinOpen":false,"tty":false,"version":"0","vcpu":1},"metadata":{"io.rancher.service.hash":"3b00ce0d910abc6af456159c91916fd48dd3146c"},"publicEndpoints":null,"removed":null,"retainIp":null,"scale":1,"scalePolicy":null,"secondaryLaunchConfigs":[],"selectorContainer":null,"selectorLink":null,"startOnCreate":false,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"upgrade":null,"uuid":"f0405b5a-6546-446e-a2bb-37d6f4da8eac","vip":null},{"id":"1s22","type":"composeService","links":{"self":"http://192.168.2.2:8080/v1/composeservices/1s22","account":"http://192.168.2.2:8080/v1/composeservices/1s22/account","consumedbyservices":"http://192.168.2.2:8080/v1/composeservices/1s22/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/composeservices/1s22/consumedservices","environment":"http://192.168.2.2:8080/v1/composeservices/1s22/environment","instances":"http://192.168.2.2:8080/v1/composeservices/1s22/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/composeservices/1s22/serviceexposemaps"},"actions":{"remove":"http://192.168.2.2:8080/v1/composeservices/1s22/?action=remove"},"name":"db","state":"active","accountId":"1a5","created":"2016-08-22T07:42:23Z","createdTS":1471851743000,"currentScale":1,"description":null,"environmentId":"1e1","externalId":null,"fqdn":null,"healthState":"healthy","kind":"composeService","launchConfig":{"accountId":"1a5","createIndex":null,"created":1471851742000,"deploymentUnitUuid":null,"description":null,"externalId":"a63c5e01f667445658f7ea45bcb7566dba72934cc832e735a02f582c28aa7b2d","firstRunning":null,"healthState":null,"hostname":"a63c5e01f667","id":4444,"kind":"container","memoryMb":null,"nativeContainer":true,"networkContainerId":null,"registryCredentialId":"1c4","removed":null,"startCount":1,"state":"starting","systemContainer":null,"userdata":null,"uuid":"84dcca92-6f04-4f0d-8ae0-7702fc803de2","version":"0"},"publicEndpoints":null,"removed":null,"scale":null,"scalePolicy":null,"secondaryLaunchConfigs":[],"selectorContainer":"com.docker.compose.project=ci, com.docker.compose.service=db","selectorLink":null,"startOnCreate":true,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"uuid":"7b415beb-5407-4cd0-bc33-ee6e79b3af84","vip":null},{"id":"1s23","type":"composeService","links":{"self":"http://192.168.2.2:8080/v1/composeservices/1s23","account":"http://192.168.2.2:8080/v1/composeservices/1s23/account","consumedbyservices":"http://192.168.2.2:8080/v1/composeservices/1s23/consumedbyservices","consumedservices":"http://192.168.2.2:8080/v1/composeservices/1s23/consumedservices","environment":"http://192.168.2.2:8080/v1/composeservices/1s23/environment","instances":"http://192.168.2.2:8080/v1/composeservices/1s23/instances","serviceExposeMaps":"http://192.168.2.2:8080/v1/composeservices/1s23/serviceexposemaps"},"actions":{"remove":"http://192.168.2.2:8080/v1/composeservices/1s23/?action=remove"},"name":"server","state":"active","accountId":"1a5","created":"2016-08-22T07:42:25Z","createdTS":1471851745000,"currentScale":1,"description":null,"environmentId":"1e1","externalId":null,"fqdn":null,"healthState":"healthy","kind":"composeService","launchConfig":{"accountId":"1a5","createIndex":null,"created":1471851744000,"deploymentUnitUuid":null,"description":null,"externalId":"cc3fd5a5b0785d3a5bd8d724bdd90e365e416f9921b669744b03cf4ebc2fdf2a","firstRunning":null,"healthState":null,"hostname":"cc3fd5a5b078","id":4445,"kind":"container","memoryMb":null,"nativeContainer":true,"networkContainerId":null,"registryCredentialId":"1c4","removed":null,"startCount":1,"state":"starting","systemContainer":null,"userdata":null,"uuid":"031cc738-68c1-4f43-85be-e8b2553f29ef","version":"0"},"publicEndpoints":null,"removed":null,"scale":null,"scalePolicy":null,"secondaryLaunchConfigs":[],"selectorContainer":"com.docker.compose.project=ci, com.docker.compose.service=server","selectorLink":null,"startOnCreate":true,"transitioning":"no","transitioningMessage":null,"transitioningProgress":null,"uuid":"7369dc0b-d789-44f2-8a83-33504a4a53e7","vip":null}],"sortLinks":{"accountId":"http://192.168.2.2:8080/v1/services?sort=accountId","createIndex":"http://192.168.2.2:8080/v1/services?sort=createIndex","created":"http://192.168.2.2:8080/v1/services?sort=created","description":"http://192.168.2.2:8080/v1/services?sort=description","environmentId":"http://192.168.2.2:8080/v1/services?sort=environmentId","externalId":"http://192.168.2.2:8080/v1/services?sort=externalId","healthState":"http://192.168.2.2:8080/v1/services?sort=healthState","id":"http://192.168.2.2:8080/v1/services?sort=id","kind":"http://192.168.2.2:8080/v1/services?sort=kind","name":"http://192.168.2.2:8080/v1/services?sort=name","removeTime":"http://192.168.2.2:8080/v1/services?sort=removeTime","removed":"http://192.168.2.2:8080/v1/services?sort=removed","selectorContainer":"http://192.168.2.2:8080/v1/services?sort=selectorContainer","selectorLink":"http://192.168.2.2:8080/v1/services?sort=selectorLink","state":"http://192.168.2.2:8080/v1/services?sort=state","uuid":"http://192.168.2.2:8080/v1/services?sort=uuid","vip":"http://192.168.2.2:8080/v1/services?sort=vip"},"pagination":{"first":null,"previous":null,"next":null,"limit":100,"total":null,"partial":false},"sort":null,"filters":{"accountId":null,"createIndex":null,"created":null,"description":null,"environmentId":null,"externalId":null,"healthState":null,"id":null,"kind":null,"name":null,"removeTime":null,"removed":null,"selectorContainer":null,"selectorLink":null,"state":null,"uuid":null,"vip":null},"createDefaults":{}}

json: cannot unmarshal number into Go value of type string

bazilio91 commented 8 years ago

Did a temporary solution, but now you should specify exact service id instead of a name. https://github.com/bazilio91/drone-rancher https://hub.docker.com/r/bazilio91/drone-rancher/

polysign commented 8 years ago

I wasn't quite happy to be hanging here for so long. So I decided to rewrite the plugin in Ruby. https://github.com/polysign/rancheroo

There might be some things missing, but I tried keeping it compatible for most of the things. It works for us and does not require switching to service IDs. Unfortunately it comes with the drawback that you need to reconfigure Drone to support third party plugins. But that was no issue for us anyway.

@bazilio91 thanks anyway for your support.

exocode commented 7 years ago

sorry, are there news on that issue?

011b303988d2: Mounted from mediatainment/ruby-on-alpine
011b303988d2: Mounted from mediatainment/ruby-on-alpine
2331367ed6be: Pushed
2331367ed6be: Pushed
latest: digest: sha256:wiredbumbers12309809238049283049029384 size: 3449
$ docker images -q -f dangling=true
[info] Pulling image plugins/drone-rancher:latest
Drone Rancher Plugin built from abcdef123
Failed to list rancher services: json: cannot unmarshal number into Go value of type string
[info] build failed (exit code 1)

snip of .drone.yml


deploy:
  # deploy to staging web
  rancher:
    url: https://rancher.mydomain.com/v1/projects/a23
    access_key: '$$RANCHER_ACCESS_KEY'
    secret_key: '$$RANCHER_SECRET_KEY'
    service: 'gn2016/web'
    docker_image: mediatainment/gn2016:latest
polysign commented 7 years ago

@exocode There was never any news on this issue so I went and created my own Rancher plugin in Ruby. It works the same and you just need to:

  1. Specify the plugin name (image: polysign/rancheroo)
  2. Enable Drone to accept any plugins (not only from their repository)
exocode commented 7 years ago

annoying :-( makes the whole Drone Integration (Plugin) on a Rancher Server useless. Or did I understand something wrong? Please help me:

How can I enable Drone to accept any plugins? I am running it within a rancher deployed version. Don't know how to do this. Sorry

rancher-plug
polysign commented 7 years ago

We run Drone manually on Rancher. Not using the version from the Rancher Catalog:

Image: drone/drone:0.4 Links to a mysql server/container Environment variables:

josmo commented 7 years ago

I'm trying to clean up what issues are still around. Is this still an issue in .5? :)

josmo commented 7 years ago

Closing this unless someone reopens for .5 :)