dokku / ansible-dokku

Ansible modules for installing and configuring Dokku
MIT License
169 stars 44 forks source link

FAILED! => {"censored": ... 'no_log: true' was specified for this result", "changed": true} #141

Closed leandroembu closed 2 years ago

leandroembu commented 2 years ago

Description of problem

Task dokku ssh-keys:add for user outputs the error:

fatal: [myhost]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": true}

How reproducible

Run this role with a valid user and a valid ssh key.

Steps to Reproduce

  1. Create a user and a ssh-key in dokku host
  2. Set dokku_users in playbook variables:
    vars:
    dokku_users:
      - name: "My Name"
        username: myusername
        ssh_key: "{{lookup('file', '~/.ssh/id_rsa.pub')}}"
  3. Run the playbook using this role

Actual Results

TASK [dokku_bot.ansible_dokku : add ssh key for user {{ item.username }}] **************************************************************
included: /home/leandro/.ansible/roles/dokku_bot.ansible_dokku/tasks/ssh-key.yml for 192.168.122.10 => (item={'name': 'Leandro Ramos', 'username': 'leandro', 'ssh_key': 'ssh-rsa a lot of chars here'})

TASK [dokku_bot.ansible_dokku : store sha256 hash of ssh key for user leandro] *********************************************************
ok: [192.168.122.10]

TASK [dokku_bot.ansible_dokku : dokku ssh-keys:add for user leandro] *******************************************************************
fatal: [192.168.122.10]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": true}

Expected Results

No fatal error.

Environment Information

dokku report APP_NAME output

-----> uname: Linux dokku 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux
-----> memory: 
                      total        used        free      shared  buff/cache   available
       Mem.:           1442         188         251           0        1002        1103
       Swap:            974           0         974
-----> docker version: 
       Client: Docker Engine - Community
        Version:           20.10.16
        API version:       1.41
        Go version:        go1.17.10
        Git commit:        aa7e414
        Built:             Thu May 12 09:17:39 2022
        OS/Arch:           linux/amd64
        Context:           default
        Experimental:      true

       Server: Docker Engine - Community
        Engine:
         Version:          20.10.16
         API version:      1.41 (minimum version 1.12)
         Go version:       go1.17.10
         Git commit:       f756502
         Built:            Thu May 12 09:15:42 2022
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.6.4
         GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
        runc:
         Version:          1.1.1
         GitCommit:        v1.1.1-0-g52de29d
        docker-init:
         Version:          0.19.0
         GitCommit:        de40ad0
-----> docker daemon info: 
       Client:
        Context:    default
        Debug Mode: true
        Plugins:
         app: Docker App (Docker Inc., v0.9.1-beta3)
         buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
         scan: Docker Scan (Docker Inc., v0.17.0)

       Server:
        Containers: 1
         Running: 0
         Paused: 0
         Stopped: 1
        Images: 21
        Server Version: 20.10.16
        Storage Driver: overlay2
         Backing Filesystem: extfs
         Supports d_type: true
         Native Overlay Diff: true
         userxattr: false
        Logging Driver: json-file
        Cgroup Driver: systemd
        Cgroup Version: 2
        Plugins:
         Volume: local
         Network: bridge host ipvlan macvlan null overlay
         Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
        Swarm: inactive
        Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
        Default Runtime: runc
        Init Binary: docker-init
        containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
        runc version: v1.1.1-0-g52de29d
        init version: de40ad0
        Security Options:
         apparmor
         seccomp
          Profile: default
         cgroupns
        Kernel Version: 5.10.0-14-amd64
        Operating System: Debian GNU/Linux 11 (bullseye)
        OSType: linux
        Architecture: x86_64
        CPUs: 2
        Total Memory: 1.409GiB
        Name: dokku
        ID: QDBG:VLYU:3QPR:46DQ:EDIW:CMLX:IP2K:XC5H:BXTO:VJ56:UVGD:U4CX
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
        Registry: https://index.docker.io/v1/
        Labels:
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false

-----> git version: git version 2.30.2
-----> sigil version: 0.8.1build+dce1c9e
-----> herokuish version: 
       herokuish: 0.5.34
       buildpacks:
         heroku-buildpack-multi     v1.0.0
         heroku-buildpack-ruby      v236
         heroku-buildpack-nodejs    v189
         heroku-buildpack-clojure   v87
         heroku-buildpack-python    v205
         heroku-buildpack-java      v69
         heroku-buildpack-gradle    v36
         heroku-buildpack-scala     v91
         heroku-buildpack-play      v26
         heroku-buildpack-php       v205
         heroku-buildpack-go        v160
         heroku-buildpack-nginx     v16
         buildpack-null             v3
-----> dokku version: dokku version 0.27.1
-----> plugn version: plugn: 0.8.2build+1b2e2b4
-----> dokku plugins: 
         00_dokku-standard    0.27.1 enabled    dokku core standard plugin
         20_events            0.27.1 enabled    dokku core events logging plugin
         app-json             0.27.1 enabled    dokku core app-json plugin
         apps                 0.27.1 enabled    dokku core apps plugin
         builder              0.27.1 enabled    dokku core builder plugin
         builder-dockerfile   0.27.1 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.27.1 enabled    dokku core builder-herokuish plugin
         builder-null         0.27.1 enabled    dokku core builder-null plugin
         builder-pack         0.27.1 enabled    dokku core builder-pack plugin
         buildpacks           0.27.1 enabled    dokku core buildpacks plugin
         certs                0.27.1 enabled    dokku core certificate management plugin
         checks               0.27.1 enabled    dokku core checks plugin
         common               0.27.1 enabled    dokku core common plugin
         config               0.27.1 enabled    dokku core config plugin
         cron                 0.27.1 enabled    dokku core cron plugin
         docker-options       0.27.1 enabled    dokku core docker-options plugin
         domains              0.27.1 enabled    dokku core domains plugin
         enter                0.27.1 enabled    dokku core enter plugin
         git                  0.27.1 enabled    dokku core git plugin
         logs                 0.27.1 enabled    dokku core logs plugin
         network              0.27.1 enabled    dokku core network plugin
         nginx-vhosts         0.27.1 enabled    dokku core nginx-vhosts plugin
         plugin               0.27.1 enabled    dokku core plugin plugin
         proxy                0.27.1 enabled    dokku core proxy plugin
         ps                   0.27.1 enabled    dokku core ps plugin
         registry             0.27.1 enabled    dokku core registry plugin
         repo                 0.27.1 enabled    dokku core repo plugin
         resource             0.27.1 enabled    dokku core resource plugin
         run                  0.27.1 enabled    dokku core run plugin
         scheduler            0.25.6 enabled    dokku core scheduler plugin
         scheduler-docker-local 0.27.1 enabled    dokku core scheduler-docker-local plugin
         scheduler-null       0.27.1 enabled    dokku core scheduler-null plugin
         shell                0.27.1 enabled    dokku core shell plugin
         ssh-keys             0.27.1 enabled    dokku core ssh-keys plugin
         storage              0.27.1 enabled    dokku core storage plugin
         trace                0.27.1 enabled    dokku core trace plugin
 !     App nextcloud does not exist
2022/05/18 13:22:35 exit status 20

How (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

Additional information

No additional information, app was not deployed.

ltalirz commented 2 years ago

Hi @leandroramos , thanks for the report. I'm currently no longer using dokku and my time to work on this role is very limited.

The continuous integration tests of this role include a user being set up https://github.com/dokku/ansible-dokku/blob/7e047c63395bfca4ede366a8c1b59ceeda023472/molecule/default/converge.yml#L21-L24 i.e. the issue you saw either is specific to your setup or it is an issue that appeared since the CI tests were last run.

You could try editing the role here https://github.com/dokku/ansible-dokku/blob/7e047c63395bfca4ede366a8c1b59ceeda023472/tasks/ssh-key.yml#L11 and see whether the log output provides any hints.

leandroembu commented 2 years ago

Thank you, @ltalirz. It was, in fact, an issue with my setup. I recreated the virtual machine and everything worked fine.