Skip to content

Instantly share code, notes, and snippets.

@lsdr
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsdr/f1be5576ce09aa4c7275 to your computer and use it in GitHub Desktop.
Save lsdr/f1be5576ce09aa4c7275 to your computer and use it in GitHub Desktop.
Problem with azk and postgresql
$ azk start
[ ... snip ...]
azk: Installing sass 3.4.9
azk: Installing sass-rails 5.0.1
azk: Installing spring 1.2.0
azk: Installing uglifier 2.6.0
azk: Installing web-console 2.0.0
azk: Your bundle is complete!
azk: It was installed into /azk/bundler
azk: postgres_development already exists
azk: rake aborted!
azk: NameError: uninitialized constant SimpleForm
azk: /azk/gaveteiro-frontend/config/initializers/simple_form.rb:2:in `<top (required)>'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:652:in `block in load_config_initializer'
azk: /azk/bundler/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:166:in `instrument'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:651:in `load_config_initializer'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
1 source 'https://rubygems.org'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:615:in `each'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:615:in `block in <class:Engine>'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `each'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `tsort_each_child'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
azk: /azk/gaveteiro-frontend/config/environment.rb:5:in `<top (required)>'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:328:in `require'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:328:in `require_environment!'
azk: /azk/bundler/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:443:in `block in run_tasks_blocks'
azk: Tasks: TOP => db:migrate => environment
azk: (See full trace by running task with --trace)
azk: `
azk: Due to the above error azk will stop all instances already begun.
azk: System `gaveteiro-frontend` not running
azk: ↓ stopping `postgres` system, 1 instances...
┌───┬────────────────────┬────────────┬────────────────────────────┬─────────────────┬─────────────┐
│ │ System │ Instancies │ Hostname │ Instances-Ports │ Provisioned │
├───┼────────────────────┼────────────┼────────────────────────────┼─────────────────┼─────────────┤
│ ↓ │ gaveteiro-frontend │ 0 │ gaveteiro-frontend.azk.dev │ - │ - │
├───┼────────────────────┼────────────┼────────────────────────────┼─────────────────┼─────────────┤
│ ↓ │ postgres │ 0 │ azk.dev │ - │ - │
└───┴────────────────────┴────────────┴────────────────────────────┴─────────────────┴─────────────┘
$ azk start --reprovision
azk: ↑ starting `postgres` system, 1 new instances...
azk: ✓ checking `wyaeld/postgres:9.3` image...
azk: ◴ waiting start `postgres` system, try connect port data/tcp...
azk: Run system `postgres` return: (1), for command: /usr/local/bin/run:
azk: Setting LOCALE to en_US.UTF-8
azk: Generating locales (this might take a while)...
azk: en_US.UTF-8... done
azk: Generation complete.
azk: 2015-01-07 01:37:32 UTC [24-1] LOG: database system was interrupted; last known up at 2015-01-07 00:41:46 UTC
azk: 2015-01-07 01:37:32 UTC [24-2] LOG: database system was not properly shut down; automatic recovery in progress
azk: 2015-01-07 01:37:32 UTC [24-3] FATAL: could not open directory "/var/run/postgresql/9.3-main.pg_stat_tmp": No such file or directory
azk: Due to the above error azk will stop all instances already begun.
azk: System `gaveteiro-frontend` not running
azk: System `postgres` not running
┌───┬────────────────────┬────────────┬────────────────────────────┬─────────────────┬─────────────┐
│ │ System │ Instancies │ Hostname │ Instances-Ports │ Provisioned │
├───┼────────────────────┼────────────┼────────────────────────────┼─────────────────┼─────────────┤
│ ↓ │ gaveteiro-frontend │ 0 │ gaveteiro-frontend.azk.dev │ - │ - │
├───┼────────────────────┼────────────┼────────────────────────────┼─────────────────┼─────────────┤
│ ↓ │ postgres │ 0 │ azk.dev │ - │ - │
└───┴────────────────────┴────────────┴────────────────────────────┴─────────────────┴─────────────┘
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
postgres: {
// Dependent systems
depends: [],
// More images: http://images.azk.io
image: "wyaeld/postgres:9.3",
shell: "/bin/bash",
wait: {"retry": 20, "timeout": 1000},
mounts: {
'/var/lib/postgresql': persistent("postgresql"),
'/var/log/postgresql': path("./log/postgresql"),
},
ports: {
// exports global variables
data: "5432/tcp",
},
envs: {
// set instances variables
POSTGRESQL_USER: "azk",
POSTGRESQL_PASS: "azk",
POSTGRESQL_DB: "postgres_development",
POSTGRESQL_HOST: "#{net.host}",
POSTGRESQL_PORT: "#{net.port.data}",
},
export_envs: {
// check this gist to configure your database
// https://gist.github.com/gullitmiranda/62082f2e47c364ef9617
DATABASE_URL: "postgres://#{envs.POSTGRESQL_USER}:#{envs.POSTGRESQL_PASS}@#{net.host}:#{net.port.data}/${envs.POSTGRESQL_DB}",
},
},
'gaveteiro-frontend': {
// Dependent systems
depends: ["postgres"],
// More images: http://images.azk.io
image: "rails:4.1",
// Steps to execute before running instances
provision: [
"bundle install --path /azk/bundler",
"bundle exec rake db:create",
"bundle exec rake db:migrate",
],
workdir: "/azk/#{manifest.dir}",
shell: "/bin/bash",
command: "bundle exec rackup config.ru --pid /tmp/rails.pid --port $HTTP_PORT",
wait: {"retry": 20, "timeout": 1000},
mounts: {
'/azk/#{manifest.dir}': path("."),
'/azk/bundler': persistent("bundler"),
},
scalable: {"default": 2},
http: {
// gaveteiro-frontend.
domains: [ "#{system.name}.#{azk.default_domain}" ]
},
envs: {
// set instances variables
RAILS_ENV: "development",
BUNDLE_APP_CONFIG: "/azk/bundler",
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment