Git Product home page Git Product logo

Comments (19)

pnabutovsky avatar pnabutovsky commented on August 16, 2024

Make sure you have created the file docker/local.env. Look at the sample files in the docker directory

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

Yes, I have docker/local.env with all needed modifications. Moreover when I tried to install and run without Docker as by instruction (build and run only the following images)

Build and Start Postgres and Solr
$ cd docker
$ cp local.env.sample.development local.env
$ ./build.sh postgres
$ ./build.sh solr
$ ./compose.local.sh up -d postgres
$ ./compose.local.sh run solr make-primero-core.sh primero-test
$ ./compose.local.sh up -d solr

...

$ rails s
$ npm run dev

I have the next error

Снимок экрана 2021-05-19 в 18 20 47

---------------------------------

When I run ./compose.configure.sh I got this -

  • bin/rails db:create
    Rspec not installed--omitting tasks
    rails aborted!
    Psych::DisallowedClass: Tried to load unspecified class: Symbol
    /srv/primero/application/app/services/config_yaml_loader.rb:11:in load' /srv/primero/application/config/initializers/action_mailer.rb:3:in <top (required)>'
    /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:285:in load' /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:285:in block in load'
    /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:257:in load_dependency' /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:285:in load'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/engine.rb:663:in block in load_config_initializer' /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:170:in instrument'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/engine.rb:662:in load_config_initializer' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/engine.rb:620:in block (2 levels) in class:Engine'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/engine.rb:619:in each' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/engine.rb:619:in block in class:Engine'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/initializable.rb:32:in instance_exec' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/initializable.rb:32:in run'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/initializable.rb:61:in block in run_initializers' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/initializable.rb:50:in each'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/initializable.rb:50:in tsort_each_child' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/initializable.rb:60:in run_initializers'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/application.rb:361:in initialize!' /srv/primero/application/config/environment.rb:5:in <top (required)>'
    /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:291:in require' /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:291:in block in require'
    /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:257:in load_dependency' /usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/dependencies.rb:291:in require'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/application.rb:337:in require_environment!' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/application.rb:520:in block in run_tasks_blocks'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/commands/rake/rake_command.rb:23:in block in perform' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/commands/rake/rake_command.rb:20:in perform'
    /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/command.rb:48:in invoke' /usr/local/bundle/gems/railties-5.2.4.4/lib/rails/commands.rb:18:in <top (required)>'
    bin/rails:4:in require' bin/rails:4:in '
    Tasks: TOP => db:create => db:load_config => environment
    (See full trace by running task with --trace)
    ERROR: 1

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

How can it work if I made step by step by this instruction and nothing works

from primero.

rbelem avatar rbelem commented on August 16, 2024

Hello @chernovroman1984
You can try my branch https://github.com/rbelem/primero/tree/docker-for-dev

Create the env files and run
docker-compose run application primero-bootstrap
docker-compose down
docker-compose up

from primero.

rbelem avatar rbelem commented on August 16, 2024

My local.env

USE_LETS_ENCRYPT=false
PRIMERO_HOST=localhost
PRIMERO_SECRET_KEY_BASE=primero
POSTGRES_PASSWORD=primero
POSTGRES_DB=primero_development
DEVISE_SECRET_KEY=primero
DEVISE_JWT_SECRET_KEY=primero
PRIMERO_MESSAGE_SECRET=primero

If you want to specify a tag add

PRIMERO_TAG=v2.0.0.28

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

Hello @chernovroman1984
You can try my branch https://github.com/rbelem/primero/tree/docker-for-dev

Create the env files and run
docker-compose run application primero-bootstrap
docker-compose down
docker-compose up

PLease explain - do I need to run these command above from the root of primero ?

from primero.

rbelem avatar rbelem commented on August 16, 2024

Hello @chernovroman1984
You can try my branch https://github.com/rbelem/primero/tree/docker-for-dev
Create the env files and run
docker-compose run application primero-bootstrap
docker-compose down
docker-compose up

PLease explain - do I need to run these command above from the root of primero ?

On the docker/ folder.

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

Thank you @rbelem !

I'm using suggested branch: git branch -a

  • docker-for-dev

I've set local.env as yours, but when I run - docker-compose run application primero-bootstrap

Step 24/48 : RUN set -euox pipefail ; mkdir -p "$APP_ROOT/tmp/export" "$RAILS_LOG_PATH" ; mkdir -p "$APP_ROOT/tmp/exports" "$RAILS_LOG_PATH" ; rake primero:i18n_js
---> Running in e8fdcdf9919a

  • mkdir -p /srv/primero/application/tmp/export /srv/primero/application/log/primero
  • mkdir -p /srv/primero/application/tmp/exports /srv/primero/application/log/primero
  • rake primero:i18n_js
    rake aborted!
    NoMethodError: undefined method []' for nil:NilClass /srv/primero/application/config/initializers/locale.rb:20:in <top (required)>'
    /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in require' /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in block in require'
    /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:257:in load_dependency' /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in require'
    /srv/primero/application/lib/tasks/primero.rake:373:in `block (2 levels) in <top (required)>'
    Tasks: TOP => primero:i18n_js
    (See full trace by running task with --trace)
    Rspec not installed--omitting tasks
    ERROR: Service 'application' failed to build : The command '/bin/sh -c set -euox pipefail ; mkdir -p "$APP_ROOT/tmp/export" "$RAILS_LOG_PATH" ; mkdir -p "$APP_ROOT/tmp/exports" "$RAILS_LOG_PATH" ; rake primero:i18n_js' returned a non-zero code: 1

from primero.

rbelem avatar rbelem commented on August 16, 2024

I will try to find what is missing then I let you know my findings.

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

I will try to find what is missing then I let you know my findings.

Hi @rbelem !

Any update? Thank you!

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

When I run Rails Server (3000 port) + Rails Webpacker (9000 port) - foreman start -f Procfile.dev 2>&1

13:28:10 web.1 | started with pid 17768
13:28:10 webpacker.1 | started with pid 17769
13:28:10 webpacker.1 |
13:28:10 webpacker.1 | > primero@ dev /opt/primero
13:28:10 webpacker.1 | > webpack-dev-server --config webpack/index.js
13:28:10 webpacker.1 |
13:28:16 web.1 | warning: parser/current is loading parser/ruby26, which recognizes
13:28:16 web.1 | warning: 2.6.2-compliant syntax, but you are running 2.6.6.
13:28:16 web.1 | warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
13:28:18 webpacker.1 | (node:17782) [DEP0131] DeprecationWarning: The legacy HTTP parser is deprecated.
13:28:18 webpacker.1 | 「wds」: Project is running at http://localhost:9000/
13:28:18 webpacker.1 | 「wds」: webpack output is served from http://localhost:9000/
13:28:18 webpacker.1 | 「wds」: Content not from webpack is served from /opt/primero/public/packs
13:28:18 webpacker.1 | 「wds」: 404s will fallback to /index.html
13:28:20 webpacker.1 | Browserslist: caniuse-lite is outdated. Please run:
13:28:20 webpacker.1 | npx browserslist@latest --update-db
13:28:29 webpacker.1 | Browserslist: caniuse-lite is outdated. Please run next command npm update
13:28:30 web.1 | => Booting Puma
13:28:30 web.1 | => Rails 5.2.6 application starting in development
13:28:30 web.1 | => Run rails server -h for more startup options
13:28:30 web.1 | Puma starting in single mode...
13:28:30 web.1 | * Version 4.3.8 (ruby 2.6.6-p146), codename: Mysterious Traveller
13:28:30 web.1 | * Min threads: 5, max threads: 5
13:28:30 web.1 | * Environment: development
13:28:30 web.1 | * Listening on tcp://0.0.0.0:3000
13:28:30 web.1 | Use Ctrl-C to stop
13:28:30 web.1 | I, [2021-05-20T13:28:30.313159 #17768] INFO -- : Started GET "/" for 127.0.0.1 at 2021-05-20 13:28:30 +0000
13:28:30 web.1 | I, [2021-05-20T13:28:30.373158 #17768] INFO -- : Processing by HomeController#v2 as HTML
13:28:31 webpacker.1 | 「wdm」: wait until bundle finished: /application.json
13:29:31 webpacker.1 | 「wdm」: wait until bundle finished: /application.json
13:29:49 web.1 | I, [2021-05-20T13:29:49.815978 #17768] INFO -- : Started GET "/" for 127.0.0.1 at 2021-05-20 13:29:49 +0000
13:29:49 web.1 | I, [2021-05-20T13:29:49.821670 #17768] INFO -- : Processing by HomeController#v2 as HTML
13:29:54 webpacker.1 | 「wdm」: wait until bundle finished: /application.json
13:29:57 webpacker.1 | 「wdm」: Child
13:29:57 webpacker.1 | 77 modules
13:29:57 webpacker.1 | Child
13:29:57 webpacker.1 | 9093 modules
13:29:57 webpacker.1 | 「wdm」: Compiled successfully.


I did strace debug for webpacker 9000 port

Снимок экрана 2021-05-20 в 16 43 28

strace -f -e trace=network -p 17782 2>&1

strace: Process 17782 attached with 11 threads
[pid 17782] accept4(20, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = 18
[pid 17782] accept4(20, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable)
[pid 17782] shutdown(18, SHUT_WR) = 0

from primero.

rbelem avatar rbelem commented on August 16, 2024

Thank you @rbelem !

I'm using suggested branch: git branch -a

* docker-for-dev

I've set local.env as yours, but when I run - docker-compose run application primero-bootstrap

Step 24/48 : RUN set -euox pipefail ; mkdir -p "$APP_ROOT/tmp/export" "$RAILS_LOG_PATH" ; mkdir -p "$APP_ROOT/tmp/exports" "$RAILS_LOG_PATH" ; rake primero:i18n_js
---> Running in e8fdcdf9919a

* mkdir -p /srv/primero/application/tmp/export /srv/primero/application/log/primero

* mkdir -p /srv/primero/application/tmp/exports /srv/primero/application/log/primero

* rake primero:i18n_js
  rake aborted!
  NoMethodError: undefined method `[]' for nil:NilClass /srv/primero/application/config/initializers/locale.rb:20:in `<top (required)>'
  /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in `require' /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in `block in require'
  /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:257:in `load_dependency' /usr/local/bundle/gems/activesupport-5.2.5/lib/active_support/dependencies.rb:291:in `require'
  /srv/primero/application/lib/tasks/primero.rake:373:in `block (2 levels) in <top (required)>'
  Tasks: TOP => primero:i18n_js
  (See full trace by running task with --trace)
  Rspec not installed--omitting tasks
  ERROR: Service 'application' failed to build : The command '/bin/sh -c set -euox pipefail         ; mkdir -p "$APP_ROOT/tmp/export" "$RAILS_LOG_PATH"         ; mkdir -p "$APP_ROOT/tmp/exports" "$RAILS_LOG_PATH"         ; rake primero:i18n_js' returned a non-zero code: 1

@chernovroman1984
It works with my branch, but when I rebase with latest development_v2 I get the same error.

from primero.

rbelem avatar rbelem commented on August 16, 2024

Working on updating the branch...

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

Working on updating the branch...

Thank you @rbelem ! Waiting for an update from you

from primero.

rbelem avatar rbelem commented on August 16, 2024

@chernovroman1984 what browser are you using?

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

@chernovroman1984 what browser are you using?

Chrome, Opera and Maxthon

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

Hi @rbelem ! Can I try some branch already?

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

@rbelem Please help!

from primero.

chernovroman1984 avatar chernovroman1984 commented on August 16, 2024

@rbelem I tried to build your repo again - docker-compose run application primero-bootstrap

Successfully built b6ba77c1e8b2
Successfully tagged primeroims/application:latest
WARNING: Image for service application was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.
Creating docker_beanstalkd_1 ... done
Creating docker_postgres_1 ... done
Creating docker_solr_1 ... done
Creating docker_application_run ... done

  • [[ -z '' ]]
  • bin/rails db:create
    Rspec not installed--omitting tasks
    D, [2021-05-22T07:59:18.196669 #45] DEBUG -- : (4.7ms) CREATE DATABASE "primero_production" ENCODING = 'utf8'
    Database 'primero_production' already exists
  • set -u
  • bin/rails db:migrate
    Rspec not installed--omitting tasks
    D, [2021-05-22T07:59:24.422314 #49] DEBUG -- : (0.5ms) SELECT pg_try_advisory_lock(818301725956221885)
    D, [2021-05-22T07:59:24.462512 #49] DEBUG -- : (3.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
    D, [2021-05-22T07:59:24.483515 #49] DEBUG -- : ActiveRecord::InternalMetadata Load (2.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
    D, [2021-05-22T07:59:24.495771 #49] DEBUG -- : (0.6ms) BEGIN
    D, [2021-05-22T07:59:24.499332 #49] DEBUG -- : (0.7ms) COMMIT
    D, [2021-05-22T07:59:24.500923 #49] DEBUG -- : (1.0ms) SELECT pg_advisory_unlock(818301725956221885)

rails aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /srv/primero/application/db/schema.rb
/usr/local/bundle/gems/activerecord-5.2.5/lib/active_record/railties/databases.rake:250:in initialize' /usr/local/bundle/gems/activerecord-5.2.5/lib/active_record/railties/databases.rake:250:in open'
/usr/local/bundle/gems/activerecord-5.2.5/lib/active_record/railties/databases.rake:250:in block (3 levels) in <top (required)>' /usr/local/bundle/gems/activerecord-5.2.5/lib/active_record/railties/databases.rake:68:in block (2 levels) in <top (required)>'
/usr/local/bundle/gems/activerecord-5.2.5/lib/active_record/railties/databases.rake:61:in block (2 levels) in <top (required)>' /usr/local/bundle/gems/railties-5.2.5/lib/rails/commands/rake/rake_command.rb:23:in block in perform'
/usr/local/bundle/gems/railties-5.2.5/lib/rails/commands/rake/rake_command.rb:20:in perform' /usr/local/bundle/gems/railties-5.2.5/lib/rails/command.rb:48:in invoke'
/usr/local/bundle/gems/railties-5.2.5/lib/rails/commands.rb:18:in <top (required)>' bin/rails:4:in require'
bin/rails:4:in `

'
Tasks: TOP => db:schema:dump
(See full trace by running task with --trace)
ERROR: 1

from primero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.