puffinrocks/puffin

docker-compose doesn't work

negativeOne1 opened this issue · 3 comments

Hi there,

just wanted to play with puffin a bit. Turns out I can't even get it up and running.

docker-compose up produces

Creating network "puffin_back" with the default driver
Creating network "puffin_front" with the default driver
Creating network "puffin_default" with the default driver
Creating puffin_puffindb_1
Creating puffin_dns_1
Creating puffin_mailhog_1
Creating puffin_puffin_1
Creating puffin_dnsfix_1
Attaching to puffin_puffindb_1, puffin_dns_1, puffin_mailhog_1, puffin_puffin_1, puffin_dnsfix_1
puffindb_1  | The files belonging to this database system will be owned by user "postgres".
puffindb_1  | This user must also own the server process.
puffindb_1  | 
mailhog_1   | 2017/01/11 10:32:03 Using in-memory storage
mailhog_1   | 2017/01/11 10:32:03 [SMTP] Binding to address: 0.0.0.0:1025
puffindb_1  | The database cluster will be initialized with locale "en_US.utf8".
puffindb_1  | The default database encoding has accordingly been set to "UTF8".
puffindb_1  | The default text search configuration will be set to "english".
puffindb_1  | 
puffindb_1  | Data page checksums are disabled.
puffindb_1  | 
puffindb_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
mailhog_1   | 2017/01/11 10:32:03 Serving under http://0.0.0.0:8025/
mailhog_1   | [HTTP] Binding to address: 0.0.0.0:8025
mailhog_1   | Creating API v1 with WebPath: 
puffindb_1  | creating subdirectories ... ok
mailhog_1   | Creating API v2 with WebPath: 
puffindb_1  | selecting default max_connections ... 100
puffindb_1  | selecting default shared_buffers ... 128MB
puffindb_1  | selecting dynamic shared memory implementation ... posix
puffindb_1  | creating configuration files ... ok
puffindb_1  | running bootstrap script ... ok
puffindb_1  | performing post-bootstrap initialization ... ok
puffindb_1  | syncing data to disk ... ok
puffindb_1  | 
puffindb_1  | Success. You can now start the database server using:
puffindb_1  | 
puffindb_1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
puffindb_1  | 
puffindb_1  | 
puffindb_1  | WARNING: enabling "trust" authentication for local connections
puffindb_1  | You can change this by editing pg_hba.conf or using the option -A, or
puffindb_1  | --auth-local and --auth-host, the next time you run initdb.
puffindb_1  | ****************************************************
puffindb_1  | WARNING: No password has been set for the database.
puffindb_1  |          This will allow anyone with access to the
puffindb_1  |          Postgres port to access your database. In
puffindb_1  |          Docker's default configuration, this is
puffindb_1  |          effectively any other container on the same
puffindb_1  |          system.
puffindb_1  | 
puffindb_1  |          Use "-e POSTGRES_PASSWORD=password" to set
puffindb_1  |          it in "docker run".
puffindb_1  | ****************************************************
puffindb_1  | waiting for server to start....LOG:  database system was shut down at 2017-01-11 10:32:05 UTC
puffindb_1  | LOG:  MultiXact member wraparound protections are now enabled
puffindb_1  | LOG:  database system is ready to accept connections
puffindb_1  | LOG:  autovacuum launcher started
puffindb_1  |  done
puffindb_1  | server started
puffindb_1  | ALTER ROLE
puffindb_1  | 
puffindb_1  | 
puffindb_1  | /docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
puffindb_1  | 
puffindb_1  | LOG:  received fast shutdown request
puffindb_1  | LOG:  aborting any active transactions
puffindb_1  | LOG:  autovacuum launcher shutting down
puffindb_1  | LOG:  shutting down
puffindb_1  | waiting for server to shut down....LOG:  database system is shut down
puffindb_1  |  done
puffindb_1  | server stopped
puffindb_1  | 
puffindb_1  | PostgreSQL init process complete; ready for start up.
puffindb_1  | 
puffindb_1  | LOG:  database system was shut down at 2017-01-11 10:32:07 UTC
puffindb_1  | LOG:  MultiXact member wraparound protections are now enabled
puffindb_1  | LOG:  autovacuum launcher started
puffindb_1  | LOG:  database system is ready to accept connections
puffin_dnsfix_1 exited with code 0
puffindb_1  | WARNING:  there is no transaction in progress
puffin_1    | Created puffin database
puffindb_1  | WARNING:  there is no transaction in progress
puffin_1    | Created puffin_test database
puffin_1    | INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
puffin_1    | INFO  [alembic.runtime.migration] Will assume transactional DDL.
puffin_1    | INFO  [alembic.runtime.migration] Running upgrade  -> 16709bf9085, empty message
puffin_1    | INFO  [alembic.runtime.migration] Running upgrade 16709bf9085 -> 400aaaf88e5, empty message
puffin_1    | INFO  [alembic.runtime.migration] Running upgrade 400aaaf88e5 -> 813ee19614, empty message
puffin_1    | INFO  [alembic.runtime.migration] Running upgrade 813ee19614 -> 16d40b17caf, empty message
puffin_1    | INFO  [alembic.runtime.migration] Running upgrade 16d40b17caf -> 4ccccdd6b0, empty message
puffin_1    | INFO  [alembic.runtime.migration] Running upgrade 4ccccdd6b0 -> 365f1188e96, empty message
puffin_1    | INFO  [alembic.runtime.migration] Running upgrade 365f1188e96 -> 31850461ed3, empty message
puffin_1    | Traceback (most recent call last):
puffin_1    |   File "puffin.py", line 196, in <module>
puffin_1    |     manager.run()
puffin_1    |   File "/usr/local/lib/python3.6/site-packages/flask_script/__init__.py", line 412, in run
puffin_1    |     result = self.handle(sys.argv[0], sys.argv[1:])
puffin_1    |   File "/usr/local/lib/python3.6/site-packages/flask_script/__init__.py", line 383, in handle
puffin_1    |     res = handle(*args, **config)
puffin_1    |   File "/usr/local/lib/python3.6/site-packages/flask_script/commands.py", line 216, in __call__
puffin_1    |     return self.run(*args, **kwargs)
puffin_1    |   File "puffin.py", line 190, in up
puffin_1    |     init()
puffin_1    |   File "puffin.py", line 181, in init
puffin_1    |     machine_proxy()
puffin_1    |   File "puffin.py", line 73, in machine_proxy
puffin_1    |     if docker.install_proxy():
puffin_1    |   File "/usr/src/app/puffin/core/docker.py", line 146, in install_proxy
puffin_1    |     return _install("_proxy")
puffin_1    |   File "/usr/src/app/puffin/core/docker.py", line 164, in _install
puffin_1    |     application = get_application(name)
puffin_1    |   File "/usr/src/app/puffin/core/applications.py", line 70, in get_application
puffin_1    |     return applications[application_id]
puffin_1    | KeyError: '_proxy'
puffin_puffin_1 exited with code 1

Hi.

First of all thanks for trying Puffin and submitting a bug report.

I think the problem is that you checked out just Puffin repository, without the Git submodules in apps/ directory.

You can either delete the repo and check it out again:

rm -rf puffin/
git clone --recursive git@github.com:puffinrocks/puffin.git

Or fix the existing repo:

cd puffin
git submodule update --init --recursive

After that docker-compose up should work.

Please let me know if it worked. In the meantime I will update the README file, since it's true that it's not clear that Puffin uses submodules.

That's it. Docker-compose is not starting without errors. I also had to add nameserver localhost to my /etc/resolv.conf. And the NGinx gave me a "wrong gateway" error when using puffin.localhost, I had to access puffin using the container ip and port 8080, after that puffin.localhost was working.

Yeah, nameserver was already documented in README.

As for nginx - weird, I think it might take some time until it updates, or maybe some cache is at play. I will add a link to localhost:8080 in README just in case, but without DNS you cannot access the started apps anyway, so it's not much use.

I am closing the ticket, thanks for your help.