{"action":"created","issue":{"url":"https://api.github.com/repos/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/125","repository_url":"https://api.github.com/repos/JrCs/docker-letsencrypt-nginx-proxy-companion","labels_url":"https://api.github.com/repos/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/125/comments","events_url":"https://api.github.com/repos/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/125/events","html_url":"https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/125","id":191498629,"number":125,"title":"DeserializationError: Deserialization error: Wrong directory fields","user":{"login":"victor-lund","id":6714401,"avatar_url":"https://avatars.githubusercontent.com/u/6714401?v=3","gravatar_id":"","url":"https://api.github.com/users/victor-lund","html_url":"https://github.com/victor-lund","followers_url":"https://api.github.com/users/victor-lund/followers","following_url":"https://api.github.com/users/victor-lund/following{/other_user}","gists_url":"https://api.github.com/users/victor-lund/gists{/gist_id}","starred_url":"https://api.github.com/users/victor-lund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victor-lund/subscriptions","organizations_url":"https://api.github.com/users/victor-lund/orgs","repos_url":"https://api.github.com/users/victor-lund/repos","events_url":"https://api.github.com/users/victor-lund/events{/privacy}","received_events_url":"https://api.github.com/users/victor-lund/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-24T11:37:54Z","updated_at":"2016-11-24T14:28:54Z","closed_at":"2016-11-24T14:24:42Z","body":"Hi there,\r\n\r\nI have come across an error that I can't seem to solve. I successfully used the docker-letsencrypt-nginx-proxy-companion before, but now when i tried using it on a new server for one of my sub-domain, I get this error when trying the easiest setup:\r\n\r\n`` DeserializationError: Deserialization error: Wrong directory fields``\r\n\r\nFull log when running docker-compose logs:\r\n\r\n```\r\nletsencrypt-nginx-proxy-companion    | + local method=GET\r\nletsencrypt-nginx-proxy-companion    | + [[ -n '' ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ -z unix:///var/run/docker.sock ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ unix:///var/run/docker.sock == unix://* ]]\r\nletsencrypt-nginx-proxy-companion    | + curl_opts+=(--unix-socket ${DOCKER_HOST#unix://})\r\nletsencrypt-nginx-proxy-companion    | + scheme=http:\r\nletsencrypt-nginx-proxy-companion    | + [[ GET = \\P\\O\\S\\T ]]\r\nletsencrypt-nginx-proxy-companion    | + curl -s --unix-socket /var/run/docker.sock -XGET http:/containers/6c377f2b4ad9/json\r\nletsencrypt-nginx-proxy-companion    | + [[ 0 -ne 0 ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ ! -d /etc/nginx/certs ]]\r\nletsencrypt-nginx-proxy-companion    | + touch /etc/nginx/certs/.check_writable\r\nletsencrypt-nginx-proxy-companion    | + [[ 0 -ne 0 ]]\r\nletsencrypt-nginx-proxy-companion    | + rm -f /etc/nginx/certs/.check_writable\r\nletsencrypt-nginx-proxy-companion    | + check_writable_directory /etc/nginx/vhost.d\r\nletsencrypt-nginx-proxy-companion    | + local dir=/etc/nginx/vhost.d\r\nletsencrypt-nginx-proxy-companion    | + grep -q '^\"/etc/nginx/vhost.d\"$'\r\nletsencrypt-nginx-proxy-companion    | + jq '.Mounts[].Destination'\r\nletsencrypt-nginx-proxy-companion    | + docker_api /containers/6c377f2b4ad9/json\r\nletsencrypt-nginx-proxy-companion    | + local scheme\r\nletsencrypt-nginx-proxy-companion    | + curl_opts=(-s)\r\nletsencrypt-nginx-proxy-companion    | + local curl_opts\r\nletsencrypt-nginx-proxy-companion    | + local method=GET\r\nletsencrypt-nginx-proxy-companion    | + [[ -n '' ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ -z unix:///var/run/docker.sock ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ unix:///var/run/docker.sock == unix://* ]]\r\nletsencrypt-nginx-proxy-companion    | + curl_opts+=(--unix-socket ${DOCKER_HOST#unix://})\r\nletsencrypt-nginx-proxy-companion    | + scheme=http:\r\nletsencrypt-nginx-proxy-companion    | + [[ GET = \\P\\O\\S\\T ]]\r\nletsencrypt-nginx-proxy-companion    | + curl -s --unix-socket /var/run/docker.sock -XGET http:/containers/6c377f2b4ad9/json\r\nletsencrypt-nginx-proxy-companion    | + [[ 0 -ne 0 ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ ! -d /etc/nginx/vhost.d ]]\r\nletsencrypt-nginx-proxy-companion    | + touch /etc/nginx/vhost.d/.check_writable\r\nletsencrypt-nginx-proxy-companion    | + [[ 0 -ne 0 ]]\r\nletsencrypt-nginx-proxy-companion    | + rm -f /etc/nginx/vhost.d/.check_writable\r\nletsencrypt-nginx-proxy-companion    | + check_writable_directory /usr/share/nginx/html\r\nletsencrypt-nginx-proxy-companion    | + local dir=/usr/share/nginx/html\r\nletsencrypt-nginx-proxy-companion    | + grep -q '^\"/usr/share/nginx/html\"$'\r\nletsencrypt-nginx-proxy-companion    | + jq '.Mounts[].Destination'\r\nletsencrypt-nginx-proxy-companion    | + docker_api /containers/6c377f2b4ad9/json\r\nletsencrypt-nginx-proxy-companion    | + local scheme\r\nletsencrypt-nginx-proxy-companion    | + curl_opts=(-s)\r\nletsencrypt-nginx-proxy-companion    | + local curl_opts\r\nletsencrypt-nginx-proxy-companion    | + local method=GET\r\nletsencrypt-nginx-proxy-companion    | + [[ -n '' ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ -z unix:///var/run/docker.sock ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ unix:///var/run/docker.sock == unix://* ]]\r\nletsencrypt-nginx-proxy-companion    | + curl_opts+=(--unix-socket ${DOCKER_HOST#unix://})\r\nletsencrypt-nginx-proxy-companion    | + scheme=http:\r\nletsencrypt-nginx-proxy-companion    | + [[ GET = \\P\\O\\S\\T ]]\r\nnginx-gen                            | 2016/11/24 11:03:53 Generated '/etc/nginx/conf.d/default.conf' from 1 containers\r\nnginx-gen                            | 2016/11/24 11:03:53 Sending container 'nginx' signal '1'\r\nnginx-gen                            | 2016/11/24 11:03:53 Watching docker events\r\nnginx-gen                            | 2016/11/24 11:03:53 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification ''\r\nnginx-gen                            | 2016/11/24 11:04:16 Received event start for container 96c8db026d9d\r\nnginx-gen                            | 2016/11/24 11:04:21 Debounce minTimer fired\r\nnginx-gen                            | 2016/11/24 11:04:21 Generated '/etc/nginx/conf.d/default.conf' from 2 containers\r\nnginx-gen                            | 2016/11/24 11:04:21 Sending container 'nginx' signal '1'\r\nnginx-gen                            | 2016/11/24 11:06:53 Received signal: hangup\r\nnginx-gen                            | 2016/11/24 11:06:53 Received signal: hangup\r\nnginx-gen                            | 2016/11/24 11:06:53 Generated '/etc/nginx/conf.d/default.conf' from 2 containers\r\nnginx-gen                            | 2016/11/24 11:06:53 Sending container 'nginx' signal '1'\r\nletsencrypt-nginx-proxy-companion    | + curl -s --unix-socket /var/run/docker.sock -XGET http:/containers/6c377f2b4ad9/json\r\nletsencrypt-nginx-proxy-companion    | + [[ 0 -ne 0 ]]\r\nletsencrypt-nginx-proxy-companion    | + [[ ! -d /usr/share/nginx/html ]]\r\nletsencrypt-nginx-proxy-companion    | + touch /usr/share/nginx/html/.check_writable\r\nletsencrypt-nginx-proxy-companion    | + [[ 0 -ne 0 ]]\r\nletsencrypt-nginx-proxy-companion    | + rm -f /usr/share/nginx/html/.check_writable\r\nletsencrypt-nginx-proxy-companion    | + check_dh_group\r\nletsencrypt-nginx-proxy-companion    | + [[ ! -f /etc/nginx/certs/dhparam.pem ]]\r\nletsencrypt-nginx-proxy-companion    | + echo 'Creating Diffie-Hellman group (can take several minutes...)'\r\nletsencrypt-nginx-proxy-companion    | Creating Diffie-Hellman group (can take several minutes...)\r\nletsencrypt-nginx-proxy-companion    | + openssl dhparam -out /etc/nginx/certs/.dhparam.pem.tmp 2048\r\nletsencrypt-nginx-proxy-companion    | Generating DH parameters, 2048 bit long safe prime, generator 2\r\nletsencrypt-nginx-proxy-companion    | This is going to take a long time\r\n\r\n\r\n// generating code\r\n\r\nletsencrypt-nginx-proxy-companion    | + mv /etc/nginx/certs/.dhparam.pem.tmp /etc/nginx/certs/dhparam.pem\r\nletsencrypt-nginx-proxy-companion    | + exec /bin/bash /app/start.sh\r\nletsencrypt-nginx-proxy-companion    | Sleep for 3600s\r\nletsencrypt-nginx-proxy-companion    | 2016/11/24 11:06:53 Generated '/app/letsencrypt_service_data' from 2 containers\r\nletsencrypt-nginx-proxy-companion    | 2016/11/24 11:06:53 Running '/app/update_certs'\r\nletsencrypt-nginx-proxy-companion    | 2016/11/24 11:06:53 Watching docker events\r\nletsencrypt-nginx-proxy-companion    | 2016/11/24 11:06:53 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/update_certs'\r\nletsencrypt-nginx-proxy-companion    | Reloading nginx proxy (using separate container nginx-gen)...\r\nletsencrypt-nginx-proxy-companion    | Creating/renewal mydomainname.com certificates... (mydomainname.com)\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:53,866:DEBUG:simp_le:1371: ['-f', 'account_key.json', '-f', 'key.pem', '-f', 'fullchain.pem', '-f', 'cert.pem', '--tos_sha256', '6373439b9f29d67a5cd4d18cbc7f264809342dbf21cb2ba2fc7588df987a6221', '-v', '-d', 'mydomainname.com', '--email', 'info@mydomainname.com', '--server=https://acme-staging.api.letsencrypt.org/directory', '--default_root', '/usr/share/nginx/html/'] parsed as Namespace(account_key_public_exponent=65537, account_key_size=4096, cert_key_size=4096, default_root='/usr/share/nginx/html/', email='info@mydomainname.com', help=False, integration_test=False, ioplugins=['account_key.json', 'key.pem', 'fullchain.pem', 'cert.pem'], reuse_key=False, revoke=False, server='https://acme-staging.api.letsencrypt.org/directory', test=False, tos_sha256='6373439b9f29d67a5cd4d18cbc7f264809342dbf21cb2ba2fc7588df987a6221', user_agent='simp_le/0', valid_min=2592000, verbose=True, version=False, vhosts=[Vhost(name='mydomainname.com', root=None)])\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:53,868:DEBUG:simp_le:367: Loading account_key.json\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:53,868:DEBUG:simp_le:367: Loading key.pem\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:53,869:DEBUG:simp_le:367: Loading fullchain.pem\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:53,869:DEBUG:simp_le:367: Loading cert.pem\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:53,869:DEBUG:simp_le:1280: Computed roots: {'mydomainname.com': '/usr/share/nginx/html/'}\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:53,869:INFO:simp_le:1211: Generating new account key\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:56,567:DEBUG:root:605: Sending GET request to https://acme-staging.api.letsencrypt.org/directory. args: (), kwargs: {}\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:56,572:INFO:requests.packages.urllib3.connectionpool:756: Starting new HTTPS connection (1): acme-staging.api.letsencrypt.org\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:56,796:DEBUG:requests.packages.urllib3.connectionpool:387: \"GET /directory HTTP/1.1\" 200 372\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:56,800:DEBUG:root:611: Received <Response [200]>. Headers: {'Content-Length': '372', 'Expires': 'Thu, 24 Nov 2016 11:06:56 GMT', 'Boulder-Request-Id': 'ymjee7KdqR_NeRxvyBQdAGYchtpXjwh5dLplrigc2BA', 'Strict-Transport-Security': 'max-age=604800', 'Server': 'nginx', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Thu, 24 Nov 2016 11:06:56 GMT', 'X-Frame-Options': 'DENY', 'Content-Type': 'application/json', 'Replay-Nonce': 'hCMbh98MyZ_ZA5qVwEvSMAxrgBgtE-ivt7fIaId4zS8'}. Content: '{\\n  \"key-change\": \"https://acme-staging.api.letsencrypt.org/acme/key-change\",\\n  \"new-authz\": \"https://acme-staging.api.letsencrypt.org/acme/new-authz\",\\n  \"new-cert\": \"https://acme-staging.api.letsencrypt.org/acme/new-cert\",\\n  \"new-reg\": \"https://acme-staging.api.letsencrypt.org/acme/new-reg\",\\n  \"revoke-cert\": \"https://acme-staging.api.letsencrypt.org/acme/revoke-cert\"\\n}'\r\nletsencrypt-nginx-proxy-companion    | 2016-11-24 11:06:56,800:DEBUG:acme.client:551: Received response <Response [200]> (headers: {'Content-Length': '372', 'Expires': 'Thu, 24 Nov 2016 11:06:56 GMT', 'Boulder-Request-Id': 'ymjee7KdqR_NeRxvyBQdAGYchtpXjwh5dLplrigc2BA', 'Strict-Transport-Security': 'max-age=604800', 'Server': 'nginx', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Thu, 24 Nov 2016 11:06:56 GMT', 'X-Frame-Options': 'DENY', 'Content-Type': 'application/json', 'Replay-Nonce': 'hCMbh98MyZ_ZA5qVwEvSMAxrgBgtE-ivt7fIaId4zS8'}): '{\\n  \"key-change\": \"https://acme-staging.api.letsencrypt.org/acme/key-change\",\\n  \"new-authz\": \"https://acme-staging.api.letsencrypt.org/acme/new-authz\",\\n  \"new-cert\": \"https://acme-staging.api.letsencrypt.org/acme/new-cert\",\\n  \"new-reg\": \"https://acme-staging.api.letsencrypt.org/acme/new-reg\",\\n  \"revoke-cert\": \"https://acme-staging.api.letsencrypt.org/acme/revoke-cert\"\\n}'\r\nletsencrypt-nginx-proxy-companion    | Traceback (most recent call last):\r\nletsencrypt-nginx-proxy-companion    |   File \"build/bdist.linux-x86_64/egg/simp_le.py\", line 1401, in main\r\nletsencrypt-nginx-proxy-companion    |     return main_with_exceptions(cli_args)\r\nletsencrypt-nginx-proxy-companion    |   File \"build/bdist.linux-x86_64/egg/simp_le.py\", line 1386, in main_with_exceptions\r\nletsencrypt-nginx-proxy-companion    |     persist_new_data(args, existing_data)\r\nletsencrypt-nginx-proxy-companion    |   File \"build/bdist.linux-x86_64/egg/simp_le.py\", line 1282, in persist_new_data\r\nletsencrypt-nginx-proxy-companion    |     client = registered_client(args, existing_data.account_key)\r\nletsencrypt-nginx-proxy-companion    |   File \"build/bdist.linux-x86_64/egg/simp_le.py\", line 1224, in registered_client\r\nletsencrypt-nginx-proxy-companion    |     client = acme_client.Client(directory=args.server, key=key, net=net)\r\nletsencrypt-nginx-proxy-companion    |   File \"build/bdist.linux-x86_64/egg/acme/client.py\", line 63, in __init__\r\nletsencrypt-nginx-proxy-companion    |     self.net.get(directory).json())\r\nletsencrypt-nginx-proxy-companion    |   File \"build/bdist.linux-x86_64/egg/acme/messages.py\", line 169, in from_json\r\nletsencrypt-nginx-proxy-companion    |     raise jose.DeserializationError(str(error))\r\nletsencrypt-nginx-proxy-companion    | DeserializationError: Deserialization error: Wrong directory fields\r\nletsencrypt-nginx-proxy-companion    | \r\nletsencrypt-nginx-proxy-companion    | Unhandled error has happened, traceback is above\r\nletsencrypt-nginx-proxy-companion    | \r\nletsencrypt-nginx-proxy-companion    | Debugging tips: -v improves output verbosity. Help is available under --help.\r\nletsencrypt-nginx-proxy-companion    | Sleep for 3600s\r\n```\r\n\r\n\r\nI tried this with the following setup:\r\n\r\n\r\n\r\n**~/docker/_proxy/docker-compose.yml:**\r\n```\r\nversion: \"2\"\r\n\r\nservices:\r\n\r\n  nginx:\r\n    image: nginx\r\n    container_name: nginx\r\n    ports:\r\n      - \"80:80\"\r\n      - \"443:443\"\r\n    volumes:\r\n      - \"/etc/nginx/conf.d\"\r\n      - \"/etc/nginx/vhost.d\"\r\n      - \"/usr/share/nginx/html\"\r\n      - \"./certs:/etc/nginx/certs:ro\"\r\n    networks:\r\n      - proxy-tier\r\n\r\n  nginx-gen:\r\n    image: jwilder/docker-gen\r\n    container_name: nginx-gen\r\n    volumes:\r\n      - \"/var/run/docker.sock:/tmp/docker.sock:ro\"\r\n      - \"./nginx-compose-v2.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro\"\r\n    volumes_from:\r\n      - nginx\r\n    entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -only-exposed -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf\r\n\r\n  letsencrypt-nginx-proxy-companion:\r\n    image: jrcs/letsencrypt-nginx-proxy-companion\r\n    container_name: letsencrypt-nginx-proxy-companion\r\n    volumes_from:\r\n      - nginx\r\n    volumes:\r\n      - \"/var/run/docker.sock:/var/run/docker.sock:ro\"\r\n      - \"./certs:/etc/nginx/certs:rw\"\r\n    environment:\r\n      - NGINX_DOCKER_GEN_CONTAINER=nginx-gen\r\n      - DEBUG=true\r\n\r\nnetworks:\r\n  proxy-tier:\r\n    external:\r\n      name: nginx-proxy\r\n```\r\n\r\n**~/docker/test/docker-compose.yml:**\r\n```\r\nversion: \"2\"\r\n\r\nservices:\r\n\r\n  simple-site:\r\n    image: nginx\r\n    container_name: simple-site\r\n    volumes:\r\n      - \"./site/conf.d/:/etc/nginx/conf.d\"\r\n      - \"./site/site/:/var/www/html\"\r\n    environment:\r\n      - VIRTUAL_HOST=mydomainname.com\r\n      - VIRTUAL_NETWORK=nginx-proxy\r\n      - VIRTUAL_PORT=80\r\n      - LETSENCRYPT_HOST=mydomainname.com\r\n      - LETSENCRYPT_EMAIL=info@mydomainname.com\r\n      - LETSENCRYPT_TEST=true\r\n      - DEBUG=true\r\n    networks:\r\n      - proxy-tier\r\n\r\nnetworks:\r\n  proxy-tier:\r\n    external:\r\n      name: nginx-proxy\r\n\r\n```\r\n\r\n\r\n**~/docker/test/site/conf.d/mydomainname.com.conf:**\r\n```\r\nserver {\r\n    listen                  80;\r\n    server_name             mydomainname.com;\r\n    root                    /var/www/html;\r\n}\r\n```\r\n\r\nIn my certs folder, an empty folder with the domain name _mydomainname.com_ is created but remains empty. nothing else is getting written to the certs folder..\r\n\r\nFurthermore, accessing http://mydomainname.com works (html is printed) but using http**s**://mydomainname.com** gives me \"mydomainname.com refused to connect.\"\r\n\r\nI am assuming that I am missing something obvious - as i said, a similar setup worked for me before - but I can't get my head around what I've done wrong...\r\n\r\nAnyone has any ideas?"},"comment":{"url":"https://api.github.com/repos/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/comments/262788653","html_url":"https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/125#issuecomment-262788653","issue_url":"https://api.github.com/repos/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/125","id":262788653,"user":{"login":"victor-lund","id":6714401,"avatar_url":"https://avatars.githubusercontent.com/u/6714401?v=3","gravatar_id":"","url":"https://api.github.com/users/victor-lund","html_url":"https://github.com/victor-lund","followers_url":"https://api.github.com/users/victor-lund/followers","following_url":"https://api.github.com/users/victor-lund/following{/other_user}","gists_url":"https://api.github.com/users/victor-lund/gists{/gist_id}","starred_url":"https://api.github.com/users/victor-lund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victor-lund/subscriptions","organizations_url":"https://api.github.com/users/victor-lund/orgs","repos_url":"https://api.github.com/users/victor-lund/repos","events_url":"https://api.github.com/users/victor-lund/events{/privacy}","received_events_url":"https://api.github.com/users/victor-lund/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T14:28:54Z","updated_at":"2016-11-24T14:28:54Z","body":"@JrCs This should probably be labeled as a bug"}}
{"actor":{"display_login":"victor-lund"}}