Skip to content

Day to day usage

Accessing the db

There are currently 2 supported ways of accessing the database from a project through a GUI.

  • PHPMyAdmin

    launchpad project pma [PROJECT_NAME]
    

  • Sequel Pro / Sequel Ace (only for MacOS)

    launchpad project db [PROJECT_NAME]
    

You can also use your own tool to connect.
To get the exposed MySQL port of your project, use following command:

docker port [PROJECT_NAME]_db_1 3306

Unfortunately the exposed port is randomly assigned on project start, so you have to update the connection string every time.

Using Xdebug

ensure port 9000 isn't in use locally

Xdebug won't work or show any error if port 9000 isn't free.
This port is sometimes used by php-fpm, which conflicts with xdebug.

You can check this with following command:
sudo lsof -i -n -P | grep TCP | grep LISTEN | grep 9000

If you see in the output other processes than PHPStorm, you need to stop those.

In the browser

By default, xdebug is turned off in the Apache.
You can toggle it with the toggle_xdebug command.

launchpad project toggle_xdebug [PROJECT_NAME]
xdebug is disabled, enabling
launchpad project toggle_xdebug [PROJECT_NAME]
xdebug is enabled, disabling

In the shell

you must start listening and accept an PHPStorm xdebug connection through the browser before you can debug CLI.
Otherwise the shell debug info can't be linked correctly to the project.

By default, xdebug is turned off in the shell container.
you can toggle it from within the shell by executing the xdebug command.

[PROJECT_NAME]  html/docroot$ xdebug
xDebug enabled.
[PROJECT_NAME]  html/docroot$ xdebug
xDebug disabled.

Use other ports than the default 81 and 444

By default launchpad doesn't use port 80 for http and port 443 for https, to not interfere with a local stack. There are command line flags to specify those ports

  • Stop the controlcenter

    launchpad controlcenter stop
    

  • Restart it with the specified ports

    launchpad controlcenter start --http-port=80 --https-port=443
    

Services and service settings can also be specified in a .dlp.yml file.
See project configuration for more info.

Recovering from a broken state

Symptoms

launchpad controlcenter start
Controlcenter already started
launchpad controlcenter status
panic: Error response from daemon: Container a5ce4b90b97710d6da5a2b42711972cbba81cdef5aee7f7f42805c7a1125ef12 is restarting, wait until the container is running

goroutine 1 [running]:
gitlab.com/dropsolid/launchpad/docker.ExecuteCommandInContainer(0xc4201f9bc0, 0xc, 0x1523056, 0xa, 0xc4201db700, 0xc4201db6c0, 0x0, 0x0, 0x0)
  /go/src/gitlab.com/dropsolid/launchpad/docker/client.go:108 +0x65b
gitlab.com/dropsolid/launchpad/controlcenter.(*ControlCenter).GetSSHKeys(0xc42024ccc0, 0x3, 0x0, 0x0)
  /go/src/gitlab.com/dropsolid/launchpad/controlcenter/controlcenter.go:480 +0x2b3
gitlab.com/dropsolid/launchpad/cmd.glob..func2(0x17df8a0, 0x18067d0, 0x0, 0x0)
  /go/src/gitlab.com/dropsolid/launchpad/cmd/controlcenter.go:87 +0x1a3
gitlab.com/dropsolid/launchpad/vendor/github.com/spf13/cobra.(*Command).execute(0x17df8a0, 0x18067d0, 0x0, 0x0, 0x17df8a0, 0x18067d0)
  /go/src/gitlab.com/dropsolid/launchpad/vendor/github.com/spf13/cobra/command.go:760 +0x2c1
gitlab.com/dropsolid/launchpad/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x17e0e00, 0x0, 0x1, 0x1)
  /go/src/gitlab.com/dropsolid/launchpad/vendor/github.com/spf13/cobra/command.go:846 +0x30a
gitlab.com/dropsolid/launchpad/vendor/github.com/spf13/cobra.(*Command).Execute(0x17e0e00, 0xc4201dbf78, 0xc420094058)
  /go/src/gitlab.com/dropsolid/launchpad/vendor/github.com/spf13/cobra/command.go:794 +0x2b
main.main()
  /go/src/gitlab.com/dropsolid/launchpad/main.go:9 +0x2d
launchpad project sync [PROJECT_NAME]
Error: The[PROJECT_NAME] docker stack can't connect to the staging environment you want to sync from

Cause

You weren't able/forgot/neglected to cleanly stop launchpad before stopping Docker or rebooting your system.
The SSH agent volume uses by the controlcenter and every project still exists, and is associated with a running or stopped container.

Fix

Launchpad currently can't (and probably will never be able to) handle this, as Docker isn't solely used by launchpad.

You can fix this by following these steps:

  • force stopping the controlcenter and all projects

    launchpad controlcenter stop --force
    

  • check for any leftover volumes

    docker volume ls
    

  • if there is any volume left (e.g. ssh-agent), try to delete those

    docker volume rm ssh-agent
    

    • if you get an error that the volume is still in use, find the container that's causing the issue and remove it
      in the example below, controlcenter_ssh_agent_1 and projectname_shell_1 were still using the ssh_agent volume

      docker volume rm ssh_agent
      Error response from daemon: remove ssh_agent: volume is in use - [e079d6cfab04ef1da9ac81fb78bbbf10c95cb0d6a319057f7f04b938c41700d1, a7572b210362fb7b9a843cff4fae3e3bbe8869e58d61be48bfb49463f02f7d65]
      
      docker ps -a
      CONTAINER ID        IMAGE                                                             COMMAND                  CREATED             STATUS              PORTS                                              NAMES
      5683699da56c        registry.gitlab.com/dropsolid/containers/dropsolid_apache:1-7.1   "/entrypoint.sh apac…"   14 minutes ago      Up 14 minutes       80/tcp, 443/tcp                                    projectname_apache_1
      7a59494fcedd        registry.gitlab.com/dropsolid/containers/dropsolid_pma            "php -S 0.0.0.0:8080…"   14 minutes ago      Up 14 minutes       8080/tcp                                           projectname_pma_1
      a7572b210362        registry.gitlab.com/dropsolid/containers/dropsolid_shell:1-7.1    "/bin/sh -c /entrypo…"   14 minutes ago      Up 14 minutes                                                          projectname_shell_1
      862e80d950a2        mysql:5.7                                                         "docker-entrypoint.s…"   14 minutes ago      Up 14 minutes       33060/tcp, 0.0.0.0:32769->3306/tcp                 projectname_db_1
      c8a4e6de2ca7        registry.gitlab.com/dropsolid/containers/dropsolid_mailhog        "mailhog"                14 minutes ago      Up 14 minutes       1025/tcp, 8025/tcp                                 projectname_mailhog_1
      e079d6cfab04        registry.gitlab.com/dropsolid/containers/dropsolid_ssh_agent:1    "/entrypoint.sh ssh-…"   16 minutes ago      Up 16 minutes                                                          controlcenter_ssh_agent_1
      85c7cf9294a4        traefik:1.7-alpine                                                "/entrypoint.sh '-c …"   16 minutes ago      Up 16 minutes       0.0.0.0:81->81/tcp, 80/tcp, 0.0.0.0:444->444/tcp   controlcenter_traefik_1
      25fbbc9d6105        jpillora/dnsmasq                                                  "webproc --config /e…"   16 minutes ago      Up 16 minutes       0.0.0.0:53->53/tcp, 0.0.0.0:53->53/udp             controlcenter_dnsmasq_1
      
      docker rm -f -v controlcenter_ssh_agent_1 projectname_shell_1
      

    • try to delete the volume again

      docker volume rm ssh-agent
      

  • start the controlcenter again

    launchpad controlcenter start
    

  • Readd your private key(s)

    launchpad controlcenter add_ssh_key ~/.ssh/id_rsa
    

  • Start the project(s) you're working on

    launchpad project start [PROJECT_NAME]