这是indexloc提供的服务,不要输入任何密码
Skip to content

Using --app flag may result in invalid dokku subcommand calls #2166

@josegonzalez

Description

@josegonzalez

Description of problem:

If you call a command using the remote client, the --app APP flag is attached to the request. Internally, dokku prepends that to the running command for core plugins, which then can be used like normal.

If a dokku command calls dokku internally, the second-level call will pick up the DOKKU_APP_NAME env var and prepend it to it's own calls, even when it already has app set properly. This is a problem for commands like config:set which will trigger a release, and therefore call dokku release APP herokuish latest, causing the command to be transformed into dokku release APP APP herokuish latest, which is going to fail as the image isn't found.

The general problem is that we're always adding DOKKU_APP_NAME, even when the flag wasn't set during the current run. Not sure what the best fix is, but we should probably set another flag somehow to avoid unshifting DOKKU_APP_NAME twice.

Output of the following commands

-----> uname: Linux dokku.josediazgonzalez.com 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
                 total       used       free     shared    buffers     cached
    Mem:           490        464         25          7         36        169
    -/+ buffers/cache:        258        231
    Swap:          999        491        508
-----> docker version:
    Client:
     Version:      1.10.3
     API version:  1.22
     Go version:   go1.5.3
     Git commit:   20f81dd
     Built:        Thu Mar 10 15:54:52 2016
     OS/Arch:      linux/amd64

    Server:
     Version:      1.10.3
     API version:  1.22
     Go version:   go1.5.3
     Git commit:   20f81dd
     Built:        Thu Mar 10 15:54:52 2016
     OS/Arch:      linux/amd64
-----> docker daemon info:
    Containers: 10
     Running: 5
     Paused: 0
     Stopped: 5
    Images: 336
    Server Version: 1.10.3
    Storage Driver: aufs
     Root Dir: /var/lib/docker/aufs
     Backing Filesystem: extfs
     Dirs: 451
     Dirperm1 Supported: false
    Execution Driver: native-0.2
    Logging Driver: json-file
    Plugins:
     Volume: local
     Network: bridge null host
    Kernel Version: 3.13.0-43-generic
    Operating System: Ubuntu 14.04.3 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 1
    Total Memory: 490 MiB
    Name: dokku.box.dev
    ID: RJDI:RRNQ:IRXS:4AZG:DD55:IC36:RUAV:QE3N:2KNJ:YCDF:33VZ:A3ZA
    WARNING: No swap limit support
-----> sigil version: 0.4.0
-----> herokuish version:
    herokuish: 0.3.12
    buildpacks:
      emberjs.tgz                latest
      buildpack-nginx            v5
      heroku-buildpack-clojure   v75
      heroku-buildpack-erlang    fa17af9
      heroku-buildpack-go        v34
      heroku-buildpack-gradle    v17
      heroku-buildpack-grails    v20
      heroku-buildpack-java      v44
      heroku-buildpack-multi     v1.0.0
      heroku-buildpack-nodejs    v90
      heroku-buildpack-php       v101
      heroku-buildpack-play      v26
      heroku-buildpack-python    v80
      heroku-buildpack-ruby      v146
      heroku-buildpack-scala     v70
-----> dokku version: 0.5.6
-----> dokku plugins:
    plugn: dev
      00_dokku-standard    0.5.6 enabled    dokku core standard plugin
      20_events            0.5.6 enabled    dokku core events logging plugin
      apps                 0.5.6 enabled    dokku core apps plugin
      auth                 0.4.0 enabled    dokku auth plugin
      build-env            0.5.6 enabled    dokku core build-env plugin
      certs                0.5.6 enabled    dokku core certificate management plugin
      checks               0.5.6 enabled    dokku core checks plugin
      common               0.5.6 enabled    dokku core common plugin
      config               0.5.6 enabled    dokku core config plugin
      copyfiles-to-image   1.0.0 enabled    dokku plugin to copy files from the host to the built docker image
      couchdb              1.0.0 enabled    dokku couchdb service plugin
      docker-options       0.5.6 enabled    dokku core docker-options plugin
      domains              0.5.6 enabled    dokku core domains plugin
      enter                0.5.6 enabled    dokku core enter plugin
      git                  0.5.6 enabled    dokku core git plugin
      letsencrypt          0.8.0 enabled    Automated installation of let's encrypt TLS certificates
      logs                 0.5.6 enabled    dokku core logs plugin
      mongo                1.0.0 enabled    dokku mongo service plugin
      mysql                1.0.0 enabled    dokku mysql service plugin
      named-containers     0.5.6 enabled    dokku core named containers plugin
      nginx-vhosts         0.5.6 enabled    dokku core nginx-vhosts plugin
      plugin               0.5.6 enabled    dokku core plugin plugin
      postgres             1.0.0 enabled    dokku postgres service plugin
      proxy                0.5.6 enabled    dokku core proxy plugin
      ps                   0.5.6 enabled    dokku core ps plugin
      redis                1.0.0 enabled    dokku redis service plugin
      rethinkdb            1.0.0 enabled    dokku rethinkdb service plugin
      shell                0.5.6 enabled    dokku core shell plugin
      storage              0.5.6 enabled    dokku core storage plugin
      tags                 0.5.6 enabled    dokku core tags plugin
      tar                  0.5.6 enabled    dokku core tar plugin

Environment details (AWS, VirtualBox, physical, etc.): DigitalOcean image
How was dokku installed?: bootstrap script
How reproducible: Every time
Steps to Reproduce:

  1. dokku couchdb:create service-name # run locally from a dokku app
  2. dokku couchdb:link service-name # run locally from a dokku repo

Actual Results: Dokku command fails overall because it prepends the app name on every subsequent embedded dokku call.
Expected Results: Linked service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions