montera34 / pageonex

PageOneX. Analyzing front pages
http://pageonex.com
GNU Affero General Public License v3.0
53 stars 13 forks source link

Dockerize application #209

Closed rporres closed 6 years ago

rporres commented 6 years ago

This will make deployments easier everywhere as we're using a very old rails and ruby version

rporres commented 6 years ago

Working on this in https://github.com/rporres/pageonex/tree/feature/dockerize

rporres commented 6 years ago

Created a base image compiling ruby v1.9.3 from source and a pageonex image on top. I had to do this as ruby 1.9.3 is not supported anymore and there are no official images.

Created also a docker compose file in order to run against a real mysql database

docker-compose up -d

Use the option --build in order to force a rebuild

Unfortunately the migrations are not working properly

docker-compose run app rake db:migrate --trace
Starting pageonex_pageonex_data_1 ... done
Starting pageonex_dbdata_1        ... done
Starting pageonex_mysql_1         ... done
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
==  DeviseCreateUsers: migrating ==============================================
-- create_table(:users)
rake aborted!
An error has occurred, all later migrations canceled:

Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead: CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `username` varchar(255) DEFAULT '' NOT NULL, `email` varchar(255) DEFAULT '' NOT NULL, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `reset_password_token` varchar(255), `reset_password_sent_at` datetime, `remember_created_at` datetime, `sign_in_count` int(11) DEFAULT 0, `current_sign_in_at` datetime, `last_sign_in_at` datetime, `current_sign_in_ip` varchar(255), `last_sign_in_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB/usr/lib/ruby/gems/1.9.1/gems/mysql2-0.3.21/lib/mysql2/client.rb:85:in `_query'
/usr/lib/ruby/gems/1.9.1/gems/mysql2-0.3.21/lib/mysql2/client.rb:85:in `query'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `block in execute'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:211:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:170:in `create_table'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:434:in `create_table'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:466:in `block in method_missing'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `block in say_with_time'
/usr/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `say_with_time'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:458:in `method_missing'
/workspace/db/migrate/20120627130452_devise_create_users.rb:3:in `change'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:407:in `block (2 levels) in migrate'
/usr/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:407:in `block in migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:389:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:528:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:in `call'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:in `ddl_transaction'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:719:in `block in migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `each'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:570:in `up'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/migration.rb:551:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:193:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/usr/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate
rporres commented 6 years ago

The problem was a migration not being compatible with MySQL 5.7

From https://dev.mysql.com/doc/refman/5.7/en/create-table.html#create-table-indexes-keys

A unique index where all key columns must be defined as NOT NULL. If they are not explicitly declared as NOT NULL, MySQL declares them so implicitly (and silently). A table can have only one PRIMARY KEY.

Created issue to fix this https://github.com/numeroteca/pageonex/issues/212

I've made it work with a MySQL 5.6 installation

rporres commented 6 years ago

When trying to access http://localhost:3000 we get this issue


Started GET "/" for 172.18.0.1 at 2018-07-23 09:34:06 +0000
Processing by HomeController#index as HTML
  Threadx Load (0.4ms)  SELECT `threadxes`.* FROM `threadxes` ORDER BY created_at DESC LIMIT 16
  Rendered home/index.html.erb within layouts/application (61.6ms)
Completed 500 Internal Server Error in 209ms

ActionView::Template::Error (undefined method `[]' for nil:NilClass):
    151:   })
    152:   </script>
    153:
    154:   <%= piwik_tracking_tag %>
    155:
    156: </html>
  app/views/layouts/application.html.erb:154:in `_app_views_layouts_application_html_erb__729913944565534490_20311540'
numeroteca commented 6 years ago

I made a fresh installation (with postgreSQL) and I did not get those errors.

rporres commented 6 years ago

Where is the piwik_tracking_tag function defined? I don't see it in the code

numeroteca commented 6 years ago

There is a gem 'piwik_analytics' that inserts the tracking code: https://github.com/matomo-org/piwik-ruby-tracking#usage

rporres commented 6 years ago

There is a gem 'piwik_analytics' that inserts the tracking code: https://github.com/matomo-org/piwik-ruby-tracking#usage

it didn't cause any further errors... that's weird. Thx!

rporres commented 6 years ago

PR: https://github.com/numeroteca/pageonex/pull/213

numeroteca commented 6 years ago

I followed the instructions:

  1. docker-compose up -d --build was giving me ERROR: Couldn't connect to Docker daemon - you might need to run "docker-machine start default".
  2. So I run sudo docker-compose up -d --build, as I saw recommended somewhere else for Linux (and also added my user usermod -aG docker ${USER}).
  3. Then I got this error :
sudo docker-compose up -d --build
Creating network "pageonex-docker_default" with the default driver
Pulling dbdata (tianon/true:)...
latest: Pulling from tianon/true
7318119b0d21: Pull complete
Digest: sha256:1db73f3610a525e10f80c62326bfbab538d9eda3c893d3cdd4b91f65ed711998
Status: Downloaded newer image for tianon/true:latest
Pulling mysql (mysql:5.6.40)...
5.6.40: Pulling from library/mysql
be8881be8156: Pull complete
c3995dabd1d7: Pull complete
9931fdda3586: Pull complete
be38c1ab6adb: Pull complete
0e4cc8d0eef6: Pull complete
879e8fa29de3: Pull complete
2bb663b27910: Pull complete
d69b0a5427b2: Pull complete
e7b152caccfa: Pull complete
cf0c833aa3c9: Pull complete
ad3f2865e236: Pull complete
Digest: sha256:29e32fba52c3e6708fdc8a7678287debe3554febced25ade8686a63d4409ceda
Status: Downloaded newer image for mysql:5.6.40
Building app
Step 1/12 : FROM pageonex/ruby-base:v1.9.3.1
v1.9.3.1: Pulling from pageonex/ruby-base
d2ca7eff5948: Pull complete
c359169181c6: Pull complete
bc504dc44c81: Pull complete
Digest: sha256:2613e60eedf3d2d1dc12b4b5a8f1bc43daf3853566e816cce0990b7c2d387af0
Status: Downloaded newer image for pageonex/ruby-base:v1.9.3.1
 ---> 803a5a320ae3
Step 2/12 : ENV PATH $PATH:/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/
 ---> Running in 789692457f8d
 ---> 3498baa2c316
Removing intermediate container 789692457f8d
Step 3/12 : WORKDIR /tmp
 ---> 71fee1b75de6
Removing intermediate container cef187e5817c
Step 4/12 : ADD ./Gemfile Gemfile
 ---> f03862629fde
Removing intermediate container f374f613e650
Step 5/12 : ADD ./Gemfile.lock Gemfile.lock
 ---> bbbd9c9d5bac
Removing intermediate container 61b93808a905
Step 6/12 : RUN bundle install
 ---> Running in 188d799a7eeb
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/...........
Fetching rake 10.0.4
Installing rake 10.0.4
Fetching i18n 0.6.1
Installing i18n 0.6.1
Fetching multi_json 1.7.2
Installing multi_json 1.7.2
Fetching activesupport 3.2.13
Installing activesupport 3.2.13
Fetching builder 3.0.4
Installing builder 3.0.4
Fetching activemodel 3.2.13
Installing activemodel 3.2.13
Fetching erubis 2.7.0
Installing erubis 2.7.0
Fetching journey 1.0.4
Installing journey 1.0.4
Fetching rack 1.4.5
Installing rack 1.4.5
Fetching rack-cache 1.2
Installing rack-cache 1.2
Fetching rack-test 0.6.2
Installing rack-test 0.6.2
Fetching hike 1.2.1
Installing hike 1.2.1
Fetching tilt 1.3.6
Installing tilt 1.3.6
Fetching sprockets 2.2.2
Installing sprockets 2.2.2
Fetching actionpack 3.2.13
Installing actionpack 3.2.13
Fetching mime-types 1.22
Installing mime-types 1.22
Fetching polyglot 0.3.3
Installing polyglot 0.3.3
Fetching treetop 1.4.12
Installing treetop 1.4.12
Fetching mail 2.5.3
Installing mail 2.5.3
Fetching actionmailer 3.2.13
Installing actionmailer 3.2.13
Fetching arel 3.0.2
Installing arel 3.0.2
Fetching tzinfo 0.3.37
Installing tzinfo 0.3.37
Fetching activerecord 3.2.13
Installing activerecord 3.2.13
Fetching activeresource 3.2.13
Installing activeresource 3.2.13
Fetching addressable 2.3.3
Installing addressable 2.3.3
Fetching bcrypt-ruby 3.0.1
Installing bcrypt-ruby 3.0.1 with native extensions
Fetching will_paginate 3.0.4
Installing will_paginate 3.0.4
Fetching bootstrap-will_paginate 0.0.9
Installing bootstrap-will_paginate 0.0.9
Using bundler 1.16.2
Fetching nokogiri 1.5.9
Installing nokogiri 1.5.9 with native extensions
Fetching ffi 1.6.0
Installing ffi 1.6.0 with native extensions
Fetching childprocess 0.3.9
Installing childprocess 0.3.9
Fetching rubyzip 0.9.9
Installing rubyzip 0.9.9
Fetching websocket 1.0.7
Installing websocket 1.0.7
Fetching selenium-webdriver 2.31.0
Installing selenium-webdriver 2.31.0
Fetching xpath 1.0.0
Installing xpath 1.0.0
Fetching capybara 2.0.3
Installing capybara 2.0.3
Fetching coderay 1.0.9
Installing coderay 1.0.9
Fetching coffee-script-source 1.6.2
Installing coffee-script-source 1.6.2
Fetching execjs 1.4.0
Installing execjs 1.4.0
Fetching coffee-script 2.2.0
Installing coffee-script 2.2.0
Fetching rack-ssl 1.3.3
Installing rack-ssl 1.3.3
Fetching json 1.7.7
Installing json 1.7.7 with native extensions
Fetching rdoc 3.12.2
Installing rdoc 3.12.2
Fetching thor 0.18.1
Installing thor 0.18.1
Fetching railties 3.2.13
Installing railties 3.2.13
Fetching coffee-rails 3.2.2
Installing coffee-rails 3.2.2
Fetching columnize 0.3.6
Installing columnize 0.3.6
Fetching commonjs 0.2.6
Installing commonjs 0.2.6
Fetching debugger-linecache 1.2.0
Installing debugger-linecache 1.2.0
Fetching debugger-ruby_core_source 1.2.3
Installing debugger-ruby_core_source 1.2.3
Fetching debugger 1.6.2
Installing debugger 1.6.2 with native extensions
Fetching orm_adapter 0.4.0
Installing orm_adapter 0.4.0
Fetching warden 1.2.1
Installing warden 1.2.1
Fetching devise 2.2.3
Installing devise 2.2.3
Fetching diff-lcs 1.2.2
Installing diff-lcs 1.2.2
Fetching factory_girl 4.2.0
Installing factory_girl 4.2.0
Fetching factory_girl_rails 4.2.1
Installing factory_girl_rails 4.2.1
Fetching faker 1.1.2
Installing faker 1.1.2
Fetching formatador 0.2.4
Installing formatador 0.2.4
Fetching listen 0.7.3
Installing listen 0.7.3
Fetching lumberjack 1.0.3
Installing lumberjack 1.0.3
Fetching method_source 0.8.1
Installing method_source 0.8.1
Fetching slop 3.4.4
Installing slop 3.4.4
Fetching pry 0.9.12
Installing pry 0.9.12
Fetching guard 1.7.0
Installing guard 1.7.0
Fetching rspec-core 2.13.1
Installing rspec-core 2.13.1
Fetching rspec-expectations 2.13.0
Installing rspec-expectations 2.13.0
Fetching rspec-mocks 2.13.0
Installing rspec-mocks 2.13.0
Fetching rspec 2.13.0
Installing rspec 2.13.0
Fetching guard-rspec 2.5.2
Installing guard-rspec 2.5.2
Fetching imagesize 0.1.1
Installing imagesize 0.1.1
Fetching jquery-rails 2.2.1
Installing jquery-rails 2.2.1
Fetching jquery-ui-rails 4.0.2
Installing jquery-ui-rails 4.0.2
Fetching launchy 2.2.0
Installing launchy 2.2.0
Fetching less 2.3.1
Installing less 2.3.1
Fetching less-rails 2.3.2
Installing less-rails 2.3.2
Fetching libv8 3.16.14.19 (x86_64-linux)
Installing libv8 3.16.14.19 (x86_64-linux)
Fetching mysql2 0.3.21
Installing mysql2 0.3.21 with native extensions
Fetching rails 3.2.13
Installing rails 3.2.13
Fetching piwik_analytics 1.0.2
Installing piwik_analytics 1.0.2
Fetching ref 2.0.0
Installing ref 2.0.0
Fetching rmagick 2.13.2
Installing rmagick 2.13.2 with native extensions
Fetching rodf 0.3.4
Installing rodf 0.3.4
Fetching rspec-rails 2.13.0
Installing rspec-rails 2.13.0
Fetching sass 3.2.7
Installing sass 3.2.7
Fetching sass-rails 3.2.6
Installing sass-rails 3.2.6
Fetching sqlite3 1.3.7
Installing sqlite3 1.3.7 with native extensions
Fetching stringex 1.5.1
Installing stringex 1.5.1
Fetching therubyracer 0.12.3
Installing therubyracer 0.12.3 with native extensions
Fetching twitter-bootstrap-rails 2.2.6
Installing twitter-bootstrap-rails 2.2.6
Fetching uglifier 1.3.0
Installing uglifier 1.3.0
Bundle complete! 27 Gemfile dependencies, 92 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Post-install message from twitter-bootstrap-rails:
Important: You may need to add a javascript runtime to your Gemfile in order for bootstrap's LESS files to compile to CSS. 

**********************************************

ExecJS supports these runtimes:

therubyracer - Google V8 embedded within Ruby

therubyrhino - Mozilla Rhino embedded within JRuby

Node.js

Apple JavaScriptCore - Included with Mac OS X

Microsoft Windows Script Host (JScript)

**********************************************
 ---> 275ed58ac207
Removing intermediate container 188d799a7eeb
Step 7/12 : ENV APP_ROOT /workspace
 ---> Running in c1340ba925c2
 ---> c5b2d1128570
Removing intermediate container c1340ba925c2
Step 8/12 : RUN mkdir -p $APP_ROOT
 ---> Running in 75b92a9b93f2
 ---> a940e7388e5b
Removing intermediate container 75b92a9b93f2
Step 9/12 : WORKDIR $APP_ROOT
 ---> db6ff5f0cabb
Removing intermediate container 067185c1293d
Step 10/12 : COPY . $APP_ROOT
 ---> e0bbc9bc1bf7
Removing intermediate container 9000fe2271d3
Step 11/12 : EXPOSE 3000
 ---> Running in 84dda141c7da
 ---> 200471aa513c
Removing intermediate container 84dda141c7da
Step 12/12 : CMD rails server -b 0.0.0.0
 ---> Running in 31cdbbef930a
 ---> 1dfcc9b71aa0
Removing intermediate container 31cdbbef930a
Successfully built 1dfcc9b71aa0
Creating pageonex-docker_app_data_1 ... done
Creating pageonex-docker_dbdata_1   ... done
Creating pageonex-docker_mysql_1    ... error

ERROR: for pageonex-docker_mysql_1  Cannot start service mysql: b'driver failed programming external connectivity on endpoint pageonex-docker_mysql_1 (709651cdb8907eef8445b695b3dbcf30594974f7a0c009fd5cc213f9de21843b): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use'

ERROR: for mysql  Cannot start service mysql: b'driver failed programming external connectivity on endpoint pageonex-docker_mysql_1 (709651cdb8907eef8445b695b3dbcf30594974f7a0c009fd5cc213f9de21843b): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use'
ERROR: Encountered errors while bringing up the project.
numeroteca commented 6 years ago

I could solve the error myswl was throwing with this solution:

sudo netstat -nlpt |grep 3306 showed me the PID and which service it was started by (mysgld) But the problem was fixed when I stopped the service by sudo service mysql stop

The installation has worked I run

sudo docker-compose run app rails server
Starting pageonex-docker_dbdata_1   ... done
Starting pageonex-docker_app_data_1 ... done
Starting pageonex-docker_mysql_1    ... done
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2018-07-23 20:11:23] INFO  WEBrick 1.3.1
[2018-07-23 20:11:23] INFO  ruby 1.9.3 (2014-11-13) [x86_64-linux]
[2018-07-23 20:11:23] INFO  WEBrick::HTTPServer#start: pid=1 port=3000

But if I go to http://0.0.0.0:3000 it is not working/listening. Is there something else I am missing?

rporres commented 6 years ago

Can you show me what you have listening to port 3000 in your laptop

netstat -na | grep 3000

Or maybe try to reach http://localhost:3000

numeroteca commented 6 years ago

netstat -na | grep 3000 or sudo netstat -nlpt |grep 3000 return nothing.

Both http://localhost:3000 and http://0.0.0.0:3000 are "Unable to connect".

rporres commented 6 years ago

sudo docker-compose run app rails server

Why didn't you use docker-compose up -d --build once you fixed the issues with ports clashing?

Do you see something in the docker-compose logs

rporres commented 6 years ago

@numeroteca I've moved the docker-compose mysql port to 13306 to avoid potential port collisions. Can you please from scratch?

As an aside note, I've also added puma

numeroteca commented 6 years ago

I've reinstalled from scratch. It didn't throw any errors.

When I run the app it says:

=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2018-08-20 09:09:12] INFO  WEBrick 1.3.1
[2018-08-20 09:09:12] INFO  ruby 1.9.3 (2014-11-13) [x86_64-linux]
[2018-08-20 09:09:12] INFO  WEBrick::HTTPServer#start: pid=1 port=3000

When I go to http://0.0.0.0:3000/ it is not working as usual.

When I go to http://0.0.0.0:13306/ I get this message:

J���
5.6.40����,G_,ZaZ|�ÿ÷�€����������%=F(3h2^cVg!�mysql_native_password�!��ÿ„#08S01Got packets out of order
rporres commented 6 years ago

There's something wrong there. It's starting WEBrick server while puma is currently the server running the application

Can you start everything from scratch?

Please copy/paste logs from the app (docker-compose logs) and the rake tasks

numeroteca commented 6 years ago

I did as requested and I get the same result as in https://github.com/numeroteca/pageonex/issues/209#issuecomment-414250898.

This is the docker log:

 $ docker-compose logs
Attaching to pageonex-dockerize3_app_1, pageonex-dockerize3_mysql_1, pageonex-dockerize3_app_data_1, pageonex-dockerize3_dbdata_1
app_1       | standard_init_linux.go:178: exec user process caused "no such file or directory"
mysql_1     | Initializing database
mysql_1     | 2018-08-27 13:05:27 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1     | 2018-08-27 13:05:27 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
mysql_1     | 2018-08-27 13:05:27 0 [Note] /usr/sbin/mysqld (mysqld 5.6.40) starting as process 36 ...
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Using atomics to ref count buffer pool pages
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: The InnoDB memory heap is disabled
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Memory barrier is not used
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Compressed tables use zlib 1.2.3
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Using Linux native AIO
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Using CPU crc32 instructions
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Initializing buffer pool, size = 128.0M
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Completed initialization of buffer pool
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Database physically writes the file full: wait...
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
mysql_1     | 2018-08-27 13:05:27 36 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
mysql_1     | 2018-08-27 13:05:28 36 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
mysql_1     | 2018-08-27 13:05:28 36 [Warning] InnoDB: New log files created, LSN=45781
mysql_1     | 2018-08-27 13:05:28 36 [Note] InnoDB: Doublewrite buffer not found: creating new
mysql_1     | 2018-08-27 13:05:29 36 [Note] InnoDB: Doublewrite buffer created
mysql_1     | 2018-08-27 13:05:29 36 [Note] InnoDB: 128 rollback segment(s) are active.
mysql_1     | 2018-08-27 13:05:29 36 [Warning] InnoDB: Creating foreign key constraint system tables.
mysql_1     | 2018-08-27 13:05:29 36 [Note] InnoDB: Foreign key constraint system tables created
mysql_1     | 2018-08-27 13:05:29 36 [Note] InnoDB: Creating tablespace and datafile system tables.
mysql_1     | 2018-08-27 13:05:29 36 [Note] InnoDB: Tablespace and datafile system tables created.
mysql_1     | 2018-08-27 13:05:29 36 [Note] InnoDB: Waiting for purge to start
mysql_1     | 2018-08-27 13:05:29 36 [Note] InnoDB: 5.6.40 started; log sequence number 0
mysql_1     | 2018-08-27 13:05:34 36 [Note] Binlog end
mysql_1     | 2018-08-27 13:05:34 36 [Note] InnoDB: FTS optimize thread exiting.
mysql_1     | 2018-08-27 13:05:34 36 [Note] InnoDB: Starting shutdown...
mysql_1     | 2018-08-27 13:05:36 36 [Note] InnoDB: Shutdown completed; log sequence number 1625977
mysql_1     | 
mysql_1     | 
mysql_1     | 2018-08-27 13:05:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1     | 2018-08-27 13:05:36 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
mysql_1     | 2018-08-27 13:05:36 0 [Note] /usr/sbin/mysqld (mysqld 5.6.40) starting as process 59 ...
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Using atomics to ref count buffer pool pages
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: The InnoDB memory heap is disabled
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Memory barrier is not used
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Compressed tables use zlib 1.2.3
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Using Linux native AIO
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Using CPU crc32 instructions
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Initializing buffer pool, size = 128.0M
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Completed initialization of buffer pool
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Highest supported file format is Barracuda.
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: 128 rollback segment(s) are active.
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Waiting for purge to start
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: 5.6.40 started; log sequence number 1625977
mysql_1     | 2018-08-27 13:05:36 59 [Note] Binlog end
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: FTS optimize thread exiting.
mysql_1     | 2018-08-27 13:05:36 59 [Note] InnoDB: Starting shutdown...
mysql_1     | 2018-08-27 13:05:38 59 [Note] InnoDB: Shutdown completed; log sequence number 1625987
mysql_1     | 
mysql_1     | 
mysql_1     | 
mysql_1     | 
mysql_1     | PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
mysql_1     | To do so, start the server, then issue the following commands:
mysql_1     | 
mysql_1     |   /usr/bin/mysqladmin -u root password 'new-password'
mysql_1     |   /usr/bin/mysqladmin -u root -h 590675efc76a password 'new-password'
mysql_1     | 
mysql_1     | Alternatively you can run:
mysql_1     | 
mysql_1     |   /usr/bin/mysql_secure_installation
mysql_1     | 
mysql_1     | which will also give you the option of removing the test
mysql_1     | databases and anonymous user created by default.  This is
mysql_1     | strongly recommended for production servers.
mysql_1     | 
mysql_1     | See the manual for more instructions.
mysql_1     | 
mysql_1     | Please report any problems at http://bugs.mysql.com/
mysql_1     | 
mysql_1     | The latest information about MySQL is available on the web at
mysql_1     | 
mysql_1     |   http://www.mysql.com
mysql_1     | 
mysql_1     | Support MySQL by buying support/licenses at http://shop.mysql.com
mysql_1     | 
mysql_1     | Note: new default config file not created.
mysql_1     | Please make sure your config file is current
mysql_1     | 
mysql_1     | WARNING: Default config file /etc/mysql/my.cnf exists on the system
mysql_1     | This file will be read by default by the MySQL server
mysql_1     | If you do not want to use this, either remove it, or use the
mysql_1     | --defaults-file argument to mysqld_safe when starting the server
mysql_1     | 
mysql_1     | Database initialized
mysql_1     | MySQL init process in progress...
mysql_1     | 2018-08-27 13:05:38 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1     | 2018-08-27 13:05:38 0 [Note] mysqld (mysqld 5.6.40) starting as process 87 ...
mysql_1     | 2018-08-27 13:05:38 87 [Note] Plugin 'FEDERATED' is disabled.
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Using atomics to ref count buffer pool pages
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: The InnoDB memory heap is disabled
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Memory barrier is not used
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Compressed tables use zlib 1.2.3
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Using Linux native AIO
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Using CPU crc32 instructions
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Initializing buffer pool, size = 128.0M
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Completed initialization of buffer pool
mysql_1     | 2018-08-27 13:05:38 87 [Note] InnoDB: Highest supported file format is Barracuda.
mysql_1     | 2018-08-27 13:05:40 87 [Note] InnoDB: 128 rollback segment(s) are active.
mysql_1     | 2018-08-27 13:05:40 87 [Note] InnoDB: Waiting for purge to start
mysql_1     | 2018-08-27 13:05:40 87 [Note] InnoDB: 5.6.40 started; log sequence number 1625987
mysql_1     | 2018-08-27 13:05:40 87 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: e5d40172-a9f9-11e8-b1e8-0242ac140002.
mysql_1     | 2018-08-27 13:05:40 87 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql_1     | 2018-08-27 13:05:40 87 [Warning] 'user' entry 'root@590675efc76a' ignored in --skip-name-resolve mode.
mysql_1     | 2018-08-27 13:05:40 87 [Warning] 'user' entry '@590675efc76a' ignored in --skip-name-resolve mode.
mysql_1     | 2018-08-27 13:05:40 87 [Warning] 'proxies_priv' entry '@ root@590675efc76a' ignored in --skip-name-resolve mode.
mysql_1     | 2018-08-27 13:05:40 87 [Note] Event Scheduler: Loaded 0 events
mysql_1     | 2018-08-27 13:05:40 87 [Note] mysqld: ready for connections.
mysql_1     | Version: '5.6.40'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL)
mysql_1     | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
mysql_1     | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
mysql_1     | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
mysql_1     | Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
mysql_1     | 2018-08-27 13:05:42 87 [Warning] 'proxies_priv' entry '@ root@590675efc76a' ignored in --skip-name-resolve mode.
mysql_1     | Warning: Using a password on the command line interface can be insecure.
mysql_1     | 
mysql_1     | 2018-08-27 13:05:42 87 [Note] mysqld: Normal shutdown
mysql_1     | 
mysql_1     | 2018-08-27 13:05:42 87 [Note] Giving 0 client threads a chance to die gracefully
mysql_1     | 2018-08-27 13:05:42 87 [Note] Event Scheduler: Purging the queue. 0 events
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down slave threads
mysql_1     | 2018-08-27 13:05:42 87 [Note] Forcefully disconnecting 0 remaining clients
mysql_1     | 2018-08-27 13:05:42 87 [Note] Binlog end
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'partition'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_FT_DELETED'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_METRICS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_CMPMEM'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_CMP_RESET'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_CMP'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_LOCKS'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'INNODB_TRX'
mysql_1     | 2018-08-27 13:05:42 87 [Note] Shutting down plugin 'InnoDB'
mysql_1     | 2018-08-27 13:05:42 87 [Note] InnoDB: FTS optimize thread exiting.
mysql_1     | 2018-08-27 13:05:42 87 [Note] InnoDB: Starting shutdown...
mysql_1     | 2018-08-27 13:05:44 87 [Note] InnoDB: Shutdown completed; log sequence number 1625997
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'BLACKHOLE'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'ARCHIVE'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'MRG_MYISAM'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'MyISAM'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'MEMORY'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'CSV'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'sha256_password'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'mysql_old_password'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'mysql_native_password'
mysql_1     | 2018-08-27 13:05:44 87 [Note] Shutting down plugin 'binlog'
mysql_1     | 2018-08-27 13:05:44 87 [Note] mysqld: Shutdown complete
mysql_1     | 
mysql_1     | 
mysql_1     | MySQL init process done. Ready for start up.
mysql_1     | 
mysql_1     | 2018-08-27 13:05:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1     | 2018-08-27 13:05:44 0 [Note] mysqld (mysqld 5.6.40) starting as process 1 ...
mysql_1     | 2018-08-27 13:05:44 1 [Note] Plugin 'FEDERATED' is disabled.
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: The InnoDB memory heap is disabled
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Memory barrier is not used
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Compressed tables use zlib 1.2.3
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Using Linux native AIO
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Using CPU crc32 instructions
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Completed initialization of buffer pool
mysql_1     | 2018-08-27 13:05:44 1 [Note] InnoDB: Highest supported file format is Barracuda.
mysql_1     | 2018-08-27 13:05:45 1 [Note] InnoDB: 128 rollback segment(s) are active.
mysql_1     | 2018-08-27 13:05:45 1 [Note] InnoDB: Waiting for purge to start
mysql_1     | 2018-08-27 13:05:45 1 [Note] InnoDB: 5.6.40 started; log sequence number 1625997
mysql_1     | 2018-08-27 13:05:45 1 [Note] Server hostname (bind-address): '*'; port: 13306
mysql_1     | 2018-08-27 13:05:45 1 [Note] IPv6 is available.
mysql_1     | 2018-08-27 13:05:45 1 [Note]   - '::' resolves to '::';
mysql_1     | 2018-08-27 13:05:45 1 [Note] Server socket created on IP: '::'.
mysql_1     | 2018-08-27 13:05:45 1 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
mysql_1     | 2018-08-27 13:05:45 1 [Warning] 'proxies_priv' entry '@ root@590675efc76a' ignored in --skip-name-resolve mode.
mysql_1     | 2018-08-27 13:05:45 1 [Note] Event Scheduler: Loaded 0 events
mysql_1     | 2018-08-27 13:05:45 1 [Note] mysqld: ready for connections.
mysql_1     | Version: '5.6.40'  socket: '/var/run/mysqld/mysqld.sock'  port: 13306  MySQL Community Server (GPL)
warning: LF will be replaced by CRLF in db/schema.rb.
The file will have its original line endings in your working directory.

Rake tasks:

$ docker-compose run app rake db:migrate --trac
Starting pageonex-dockerize3_dbdata_1   ... done
Starting pageonex-dockerize3_app_data_1 ... done
Starting pageonex-dockerize3_mysql_1    ... done
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
==  DeviseCreateUsers: migrating ==============================================
-- create_table(:users)
   -> 0.2609s
-- add_index(:users, :email, {:unique=>true})
   -> 0.2178s
-- add_index(:users, :reset_password_token, {:unique=>true})
   -> 0.2254s
==  DeviseCreateUsers: migrated (0.7045s) =====================================

==  CreateThreadxes: migrating ================================================
-- create_table(:threadxes)
   -> 0.2851s
==  CreateThreadxes: migrated (0.2852s) =======================================

==  CreateMedia: migrating ====================================================
-- create_table(:media)
   -> 0.2898s
==  CreateMedia: migrated (0.2900s) ===========================================

==  CreateAreas: migrating ====================================================
-- create_table(:areas)
   -> 0.7251s
==  CreateAreas: migrated (0.7253s) ===========================================

==  CreateHighlightedAreas: migrating =========================================
-- create_table(:highlighted_areas)
   -> 0.4038s
==  CreateHighlightedAreas: migrated (0.4039s) ================================

==  CreateCodes: migrating ====================================================
-- create_table(:codes)
   -> 0.9296s
==  CreateCodes: migrated (0.9298s) ===========================================

==  CreateImages: migrating ===================================================
-- create_table(:images)
   -> 1.5505s
==  CreateImages: migrated (1.5506s) ==========================================

==  CreateThreadxCollaborators: migrating =====================================
-- create_table(:threadx_collaborators)
   -> 1.6538s
==  CreateThreadxCollaborators: migrated (1.6539s) ============================

==  CreateThreadxImages: migrating ============================================
-- create_table(:threadx_images)
   -> 4.8350s
==  CreateThreadxImages: migrated (4.8352s) ===================================

==  CreateMediaThreadxes: migrating ===========================================
-- create_table(:media_threadxes)
   -> 1.8317s
==  CreateMediaThreadxes: migrated (1.8320s) ==================================

==  AddDisplayNameToMedia: migrating ==========================================
-- add_column(:media, :display_name, :string)
   -> 2.5428s
==  AddDisplayNameToMedia: migrated (2.5429s) =================================

==  AddCodeDescriptionToCode: migrating =======================================
-- add_column(:codes, :code_description, :text)
   -> 1.1699s
==  AddCodeDescriptionToCode: migrated (1.1700s) ==============================

==  AddColorToCode: migrating =================================================
-- add_column(:codes, :color, :string)
   -> 1.6903s
==  AddColorToCode: migrated (1.6904s) ========================================

==  AddWidthToArea: migrating =================================================
-- add_column(:areas, :width, :integer)
   -> 1.7315s
==  AddWidthToArea: migrated (1.7317s) ========================================

==  AddHeightToArea: migrating ================================================
-- add_column(:areas, :height, :integer)
   -> 2.0267s
==  AddHeightToArea: migrated (2.0269s) =======================================

==  AddImageNameToImage: migrating ============================================
-- add_column(:images, :image_name, :string)
   -> 1.7723s
==  AddImageNameToImage: migrated (1.7723s) ===================================

==  RenameThreadxImageIdToCodeIdFromHighlightedArea: migrating ================
-- rename_column(:highlighted_areas, :threadx_image_id, :code_id)
   -> 0.4138s
==  RenameThreadxImageIdToCodeIdFromHighlightedArea: migrated (0.4139s) =======

==  CreateImageCodes: migrating ===============================================
-- create_table(:image_codes)
   -> 1.0081s
==  CreateImageCodes: migrated (1.0082s) ======================================

==  AddNameToHighlightedArea: migrating =======================================
-- add_column(:highlighted_areas, :name, :string)
   -> 2.6712s
==  AddNameToHighlightedArea: migrated (2.6714s) ==============================

==  AddThreadxIdToHighlightedArea: migrating ==================================
-- add_column(:highlighted_areas, :threadx_id, :integer)
   -> 1.4508s
==  AddThreadxIdToHighlightedArea: migrated (1.4509s) =========================

==  ChangeSizeTypeInImage: migrating ==========================================
-- change_column(:images, :size, :string)
   -> 1.9197s
==  ChangeSizeTypeInImage: migrated (1.9199s) =================================

==  DropThreadxImages: migrating ==============================================
-- drop_table(:threadx_images)
   -> 0.3954s
==  DropThreadxImages: migrated (0.3955s) =====================================

==  DropImageCodes: migrating =================================================
-- drop_table(:image_codes)
   -> 0.2885s
==  DropImageCodes: migrated (0.2887s) ========================================

==  RemoveThreadxIdFromHighlightedArea: migrating =============================
-- remove_column(:highlighted_areas, :threadx_id)
   -> 2.9881s
==  RemoveThreadxIdFromHighlightedArea: migrated (2.9883s) ====================

==  CreateCodedPages: migrating ===============================================
-- create_table(:coded_pages)
   -> 0.6961s
==  CreateCodedPages: migrated (0.6963s) ======================================

==  FixColumnMediaName: migrating =============================================
-- rename_column(:media, :city, :country_code)
   -> 0.2195s
==  FixColumnMediaName: migrated (0.2197s) ====================================

==  AddSourceUrlToImage: migrating ============================================
-- add_column(:images, :source_url, :string)
   -> 1.1769s
==  AddSourceUrlToImage: migrated (1.1771s) ===================================

==  AddMissingToImage: migrating ==============================================
-- add_column(:images, :missing, :boolean)
   -> 1.2210s
==  AddMissingToImage: migrated (1.2212s) =====================================

==  AddWorkingToMedia: migrating ==============================================
-- add_column(:media, :working, :boolean, {:default=>true})
   -> 1.1653s
==  AddWorkingToMedia: migrated (1.1655s) =====================================

==  AddAdminToUsers: migrating ================================================
-- add_column(:users, :admin, :boolean)
   -> 1.7624s
==  AddAdminToUsers: migrated (1.7625s) =======================================

==  RemoveImageLocalPath: migrating ===========================================
-- remove_column(:images, :local_path)
   -> 2.6668s
==  RemoveImageLocalPath: migrated (2.6670s) ==================================

==  AddBioToUsers: migrating ==================================================
-- add_column(:users, :bio, :text)
   -> 1.8606s
==  AddBioToUsers: migrated (1.8608s) =========================================

==  AddParentIdToThreads: migrating ===========================================
-- add_column(:threadxes, :parent_id, :integer)
   -> 1.1475s
==  AddParentIdToThreads: migrated (1.1476s) ==================================

==  CreateTaxonomies: migrating ===============================================
-- create_table(:taxonomies)
   -> 0.8828s
==  CreateTaxonomies: migrated (0.8829s) ======================================

==  CreateTaxonomyOptions: migrating ==========================================
-- create_table(:taxonomy_options)
   -> 0.5423s
==  CreateTaxonomyOptions: migrated (0.5424s) =================================

==  CreateThreadxTaxonomies: migrating ========================================
-- create_table(:threadx_taxonomies)
   -> 0.2559s
==  CreateThreadxTaxonomies: migrated (0.2560s) ===============================

==  CreateTaxonomyClassifications: migrating ==================================
-- create_table(:taxonomy_classifications)
   -> 0.2983s
==  CreateTaxonomyClassifications: migrated (0.2984s) =========================

** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment 
** Invoke db:load_config 
** Execute db:schema:dump

and more rake tasks:

$ docker-compose run app rake scraping:update_media --trace
Starting pageonex-dockerize3_dbdata_1   ... done
Starting pageonex-dockerize3_app_data_1 ... done
Starting pageonex-dockerize3_mysql_1    ... done
** Invoke scraping:update_media (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute scraping:update_media
Will update database from public/kiosko_media_list.csv
  line 2: created buenosaires_economico
  line 3: created buenos_aires_herald
  line 4: created ar_clarin
  line 5: created ar_cronica
  line 6: created ar_ambito
  line 7: created ar_liberal
  line 8: created ar_libertador
  line 9: created ar_litoral_sfe
  line 10: created ar_sureno
  line 11: created jornada_mendoza
 [...]
  line 723: created ve_ultimasnoticias
Media update from public/kiosko_media_list.csv finished.  Created 722 new media:
  buenosaires_economico
  buenos_aires_herald
  ar_clarin
  ar_cronica
  ar_ambito
  ar_liberal
  ar_libertador
  ar_litoral_sfe
  ar_sureno
  jornada_mendoza
[...]
  ve_ultimasnoticias
Done
rporres commented 6 years ago

There's a message there that's intriguing

app_1       | standard_init_linux.go:178: exec user process caused "no such file or directory"

I'll try to reproduce it from a fresh installation

rporres commented 6 years ago

I haven't been able to reproduce it in a fresh ubuntu16 installation. Which OS are you using to run this, @numeroteca?

numeroteca commented 6 years ago

Ubuntu 16.04.

numeroteca commented 6 years ago

In our meeting we were able to find the problem. It was related to line endings. I had my git set to add CRLF line endings (see more info: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration), so the file docker-compose.yml had these ugly ^M at the end of every line:

version: '2'^M
services:^M
  mysql:^M
...

I removed that part related to CRLF line endings in my global git configuration (~/.gitconfig) and clone and make the whole process again. It worked!!

Thanks @rporres.

PS: to come clean, we removed unused docker images and containers:

  1. List images: docker images
  2. Remove images: docker rmi pageonex-dockerize3_app pageonex-dockerize2_app
  3. List container:docker ps -a
  4. Remove containers (by id): docker rm fb4ad1819464 014e9f2f6413 25ca2fb1fc9a
rporres commented 6 years ago

Just a note. Those instructions are quite specific to @numeroteca's issues...

rahulbot commented 6 years ago

Hi - I manage the production deployment. Let me know when you have a release that is ready to spin up on a containerized development server here for testing. I'd like to have production running the docker-ized version by the end of the year (if not earlier).

rporres commented 6 years ago

Hi @rahulbot. We've just finished connecting this repo to Travis and we create containers when a new tag is created

See https://github.com/montera34/pageonex/pull/215 for details on Travis integrations and https://hub.docker.com/r/pageonex/pageonex/tags/ for the containers created.

Let's get @numeroteca test the container and then we'll come back to you for the migration details.

rahulbot commented 6 years ago

Any updates on this?

numeroteca commented 6 years ago

I am discussing with @rporres how to deal with all the proposed tasks. @rahulbot were you able to test the dockerized container?