dokku / dokku

A docker-powered PaaS that helps you build and manage the lifecycle of applications
https://dokku.com
MIT License
29.23k stars 1.92k forks source link

App disappear after git push #2960

Closed buckle2000 closed 6 years ago

buckle2000 commented 7 years ago

Description of problem:

App disappear after git push

Output of the following commands:

-----> uname: Linux scw-fa315e 4.4.38-std-1 #1 SMP Mon Dec 12 10:45:29 UTC 2016                                                                                                                                                              x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
              total        used        free      shared  buff/cache   available
Mem:           2003         308        1044          18         649        1433
Swap:             0           0           0
-----> docker version:
Client:
 Version:      17.10.0-ce
 API version:  1.33
 Go version:   go1.8.3
 Git commit:   f4ffd25
 Built:        Tue Oct 17 19:04:16 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.10.0-ce
 API version:  1.33 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   f4ffd25
 Built:        Tue Oct 17 19:02:56 2017
 OS/Arch:      linux/amd64
 Experimental: false
-----> docker daemon info:
Containers: 6
 Running: 4
 Paused: 0
 Stopped: 2
Images: 27
Server Version: 17.10.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 0351df1c5a66838d0c392b4ac4cf9450de844e2d
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.4.38-std-1
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.956GiB
Name: scw-fa315e
ID: OYWF:VSE7:XRLW:YSRR:LYZD:QNBH:XKJ4:AEU2:CK42:AMBD:2KV2:JADH
Docker Root Dir: /var/lib/docker
Debug Mode (client): true
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
-----> sigil version: 0.4.0
-----> herokuish version:
herokuish: 0.3.32
buildpacks:
  heroku-buildpack-multi     v1.0.0
  heroku-buildpack-ruby      v168
  heroku-buildpack-nodejs    v99
  heroku-buildpack-clojure   v77
  heroku-buildpack-python    v99
  heroku-buildpack-java      v53
  heroku-buildpack-gradle    v23
  heroku-buildpack-scala     v78
  heroku-buildpack-play      v26
  heroku-buildpack-php       v122
  heroku-buildpack-go        v72
  heroku-buildpack-erlang    fa17af9
  buildpack-nginx            v8
-----> dokku version: 0.10.5
-----> dokku plugins:
plugn: 0.3.0
  00_dokku-standard    0.10.5 enabled    dokku core standard plugin
  20_events            0.10.5 enabled    dokku core events logging plugin
  apps                 0.10.5 enabled    dokku core apps plugin
  build-env            0.10.5 enabled    dokku core build-env plugin
  certs                0.10.5 enabled    dokku core certificate management plugin
  checks               0.10.5 enabled    dokku core checks plugin
  common               0.10.5 enabled    dokku core common plugin
  config               0.10.5 enabled    dokku core config plugin
  docker-options       0.10.5 enabled    dokku core docker-options plugin
  domains              0.10.5 enabled    dokku core domains plugin
  enter                0.10.5 enabled    dokku core enter plugin
  git                  0.10.5 enabled    dokku core git plugin
  logs                 0.10.5 enabled    dokku core logs plugin
  named-containers     0.10.5 enabled    dokku core named containers plugin
  nginx-vhosts         0.10.5 enabled    dokku core nginx-vhosts plugin
  plugin               0.10.5 enabled    dokku core plugin plugin
  proxy                0.10.5 enabled    dokku core proxy plugin
  ps                   0.10.5 enabled    dokku core ps plugin
  repo                 0.10.5 enabled    dokku core repo plugin
  rethinkdb            1.0.0 enabled    dokku rethinkdb service plugin
  shell                0.10.5 enabled    dokku core shell plugin
  ssh-keys             0.10.5 enabled    dokku core ssh-keys plugin
  storage              0.10.5 enabled    dokku core storage plugin
  tags                 0.10.5 enabled    dokku core tags plugin
  tar                  0.10.5 enabled    dokku core tar plugin

Environment details (AWS, VirtualBox, physical, etc.):

Scaleway Ubuntu Xenial; fresh install.

How was Dokku installed?:

The 2-line install from command line.

How reproducible:

  1. dokku apps:create my-app
  2. clone this project
  3. set git remote url to ....../my-app
  4. git push dokku master
  5. Wait for 5 minutes

Actual Results:

$ dokku apps:list
====>

Yeah, nothing!

Expected Results:

$ dokku apps:list
====>
my-app

Additional Info:

docker is still functional

josegonzalez commented 7 years ago

Your git remote is wrong. Use a colon instead of a forward-slash to separate the remote and the app name.

buckle2000 commented 7 years ago

I am sure I did nothing wrong at that. The "push process" goes without any error.

buckle2000 commented 7 years ago

@josegonzalez what about ssh://hostname/my-app?

buckle2000 commented 7 years ago

Anyway, I believe this is a bug of dokku.

josegonzalez commented 7 years ago

That is also not a valid name. From our docs:

Note: Some tools may not support the short-upstream syntax referenced above, and you may need to prefix the upstream with the scheme ssh:// like so: ssh://dokku@dokku.me:ruby-rails-sample Please see the Git documentation for more details.

Can you try it with a valid remote name?

buckle2000 commented 7 years ago

I already tried it 5 times with valid remote name and different app names. In fact, after doing all 1-5 steps you won't notice anything unusual. I am quite confused about why the app will disappear from dokku apps:list

josegonzalez commented 7 years ago

Great, can I see the entire output of the:

ls -lah /home/dokku
dokku --trace apps:list

And then turn on trace mode:

dokku trace on

And the entire output of the deploy? Please do not truncate the output or modify it in any way except to remove secrets.

buckle2000 commented 7 years ago
# ls -lah /home/dokku
total 44K
drwxr-xr-x 5 dokku dokku 4.0K <Time here> .
drwxr-xr-x 3 root  root  4.0K <Time here> ..
drwxr-xr-x 2 dokku dokku 4.0K <Time here> .basher
-rw-r--r-- 1 dokku dokku  220 <Time here> .bash_logout
-rw-r--r-- 1 dokku dokku 3.7K <Time here> .bashrc
drwx------ 2 dokku dokku 4.0K <Time here> .cache
-rw-r--r-- 1 root  root     0 <Time here> ENV
-rw-r--r-- 1 dokku dokku   11 <Time here> HOSTNAME
-rw-r--r-- 1 dokku dokku  655 <Time here> .profile
drwxr-xr-x 2 dokku root  4.0K <Time here> .ssh
-rw-r--r-- 1 dokku root    15 <Time here> .sshcommand
-rw-r--r-- 1 root  root     7 <Time here> VERSION
# dokku --trace apps:list
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ DOKKU_GLOBAL_RUN_ARGS=--label=dokku
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args apps:list
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ for arg in '"$@"'
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ next_index=2
+ return 0
+ args=("$@")
+ skip_arg=false
+ [[ apps:list =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ /usr/bin/tty
+ [[ /dev/pts/1 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ apps:list =~ ^plugin:.* ]]
+ [[ apps:list == \s\s\h\-\k\e\y\s\:\a\d\d ]]
+ [[ -n '' ]]
+ dokku_auth apps:list
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=root
+ SSH_USER=root
+ export SSH_NAME=default
+ SSH_NAME=default
+ plugn trigger user-auth root default apps:list
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ apps:list =~ (ssh-keys:add|ssh-keys:remove) ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd apps:list
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=apps:list
+ local PLUGIN_CMD=apps:list
+ local implemented=0
+ local script
+ argv=("$@")
+ local argv
+ case "$PLUGIN_NAME" in
++ readlink -f /var/lib/dokku/plugins/enabled/apps
+ [[ /var/lib/dokku/core-plugins/available/apps == *core-plugins* ]]
+ [[ apps:list == \a\p\p\s\:\l\i\s\t ]]
+ shift 1
+ [[ ! -z '' ]]
+ set -- apps:list
+ [[ -x /var/lib/dokku/plugins/enabled/apps:list/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/apps:list/subcommands/apps:list ]]
+ [[ -x /var/lib/dokku/plugins/enabled/apps/subcommands/list ]]
+ [[ -n list ]]
+ /var/lib/dokku/plugins/enabled/apps/subcommands/list apps:list
+ source /var/lib/dokku/plugins/available/apps/internal-functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ apps_list_cmd apps:list
+ declare 'desc=lists all apps'
+ local cmd=apps
+ local app
+ dokku_log_info2_quiet 'My Apps'
+ declare 'desc=log info2 formatter (with quiet option)'
+ [[ -z '' ]]
+ echo '=====> My Apps'
=====> My Apps
++ dokku_apps
++ declare 'desc=prints list of all local apps'
+++ find /home/dokku -follow -maxdepth 1 -mindepth 1 -type d '!' -name tls '!' -                                                                                                                                                             name '.*' -printf '%f\n'
+++ sort
++ local INSTALLED_APPS=
++ [[ -n '' ]]
+ implemented=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 0 ]]

Deploy output: wait a minute

buckle2000 commented 7 years ago

OK, new discovery. Only when I push a new update to the server, this problem will happen. If I push the same commit twice (then the build time is short because all containers are cached), dokku works fine. Maybe it has something to do with caching & buffer overflow / timeout.

josegonzalez commented 7 years ago

Please get me the output of both the first and second deploy. Can you also post the exact contents of the remote url that results in the deletion?

buckle2000 commented 7 years ago

Strange, everything works fine now. Here is the log of a successful deploy with trace on. stderr.txt

buckle2000 commented 7 years ago

OK, this time the app vanished a little bit late.

josegonzalez commented 7 years ago

I believe you changed it to a correct remote and it finally works.

For reference, we've recently fixed some issues regarding remote parsing, though that hasn't landed in a release, just master.

buckle2000 commented 7 years ago

No, I am 100% it is not something about remote url.

josegonzalez commented 7 years ago

Uh thats.. strange. What is the exact remote you are using?

buckle2000 commented 7 years ago

ssh://dokku@51.15.x.y/bucket Just this, nothing special

josegonzalez commented 7 years ago

Change your remote to:

ssh://dokku@51.15.x.y:bucket

Then push, make a small change, and push again. Your app should work.

buckle2000 commented 7 years ago
> git push dokku master
fatal: No path specified. See 'man git-pull' for valid url syntax

ssh://dokku@51.15.x.y:bucket is not a valid url

josegonzalez commented 7 years ago

What version of git are you running?

As well, is the log output from above for the deploy from right before your app suddenly disappears?

buckle2000 commented 7 years ago

No actually, they are 2 separate deployments, but with the similar codebase. I believe there is nothing to do with git push.

josegonzalez commented 7 years ago

Okay well can you show me the output from the deployment that makes the app disappear? Also, git -v output.

buckle2000 commented 7 years ago
> git --version
git version 2.15.0.windows.1

Sorry I lost the output from the deployment that makes the app disappear. But indeed it seems normal.

josegonzalez commented 7 years ago

Sorry, I meant the version on the server.

We'll definitely need the output from the deployment that makes the app disappear. I'm not able to replicate this at all anywhere at the moment.

josegonzalez commented 6 years ago

Closing as there hasn't been any update in three weeks. Feel free to comment with further information and we'd be glad to take a look.