hitobito / development Goto Github PK
View Code? Open in Web Editor NEWSetup your local machine for hitobito development
License: GNU Affero General Public License v3.0
Setup your local machine for hitobito development
License: GNU Affero General Public License v3.0
I just built all containers from scratch and added a new user (so that I don't have to use the root user, see #3).
I've "sent" a login link to the new user, but this mail does not show up inside MailCatcher. The MailCatcher is running (the website on port 1080 is accessible).
What can I do to solve this?
Hoi zäme
Evtl. stehe ich etwas auf dem Schlauch, aber gibt es eine Möglichkeit HitoBito auf Macbooks mit einem M1 Prozessor zu entwickeln? Ich habe als einzige Änderung bei den container/services die Platform auf linux/x86_64
gesetzt, damit das System überhaupt startet.
Lokales Docker-Compose:
version: '3.4'
services:
rails: &rails
platform: linux/x86_64
build:
context: ./docker
dockerfile: rails.dockerfile
image: ghcr.io/hitobito/development/rails
user: "${RAILS_UID:-1000}"
tty: true
stdin_open: true
depends_on:
- db
- mailcatcher
- cache
- webpack
env_file: docker/rails.env
environment:
WEBPACKER_DEV_SERVER_HOST: webpack
ports:
- "3000:3000"
volumes:
- ./app/:/usr/src/app
- hitobito_bundle:/opt/bundle
- seed:/seed
- ./docker/home/rails:/home/developer
- /tmp/.X11-unix:/tmp/.X11-unix
- ./docker/rails/work_around_docker_fs_bug.rb:/usr/src/app/hitobito/config/initializers/work_around_docker_fs_bug.rb:ro
# `exec` into this to execute the tests of the core
rails_test_core:
<<: *rails
command: [ 'sleep', 'infinity' ]
ports: []
platform: linux/x86_64
environment:
WAGONS: ''
RAILS_ENV: test
RAILS_TEST_DB_NAME: "hitobito_test_core"
WEBPACKER_DEV_SERVER_HOST: null
RAILS_SPHINX_HOST: null
SKIP_SEEDS: 1
SKIP_BUNDLE_INSTALL: 1
depends_on:
- db
worker:
<<: *rails
command: [ 'rails', 'jobs:work' ]
ports: []
platform: linux/x86_64
environment:
SKIP_RAILS_MIGRATIONS: 1
SKIP_SEEDS: 1
SKIP_BUNDLE_INSTALL: 1
depends_on:
- rails
- db
- mailcatcher
- cache
# Dependencies
mailcatcher:
platform: linux/x86_64
image: ghcr.io/hitobito/development/mailcatcher
build:
context: ./docker
dockerfile: mailcatcher.dockerfile
ports:
- "1080:1080"
cache:
image: memcached:1.6-alpine
command: [ memcached, -l, '0.0.0.0', -p, '11211' ]
sphinx:
image: macbre/sphinxsearch:3.1.1
platform: linux/x86_64
command: sphinx-start
depends_on:
- db
volumes:
- ./docker/sphinx.conf:/opt/sphinx/conf/sphinx.conf:ro
- ./docker/sphinx-start:/usr/local/bin/sphinx-start:ro
- ./docker/sphinx-indexer:/usr/local/bin/sphinx-indexer:ro
- sphinx_indexes:/opt/sphinx/indexes
db:
image: mysql:5.7
platform: linux/x86_64
command:
- --sort_buffer_size=2M
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
env_file: ./docker/mysql.env
ports:
- "33066:3306"
volumes:
- ./docker/mysql-setup.sql:/docker-entrypoint-initdb.d/mysql-setup.sql:ro
- ./docker/test-setup.sql:/docker-entrypoint-initdb.d/test-setup.sql:ro
- db:/var/lib/mysql
webpack:
build:
context: ./docker
dockerfile: rails.dockerfile
image: ghcr.io/hitobito/development/rails
platform: linux/x86_64
entrypoint: [ "webpack-entrypoint" ]
env_file: docker/rails.env
environment:
WEBPACKER_DEV_SERVER_HOST: webpack
SKIP_BUNDLE_INSTALL: 1
user: "${RAILS_UID:-1000}"
command: /usr/src/app/hitobito/bin/webpack-dev-server
ports:
- "3035:3035"
volumes:
- ./app/:/usr/src/app
- hitobito_bundle:/opt/bundle
- hitobito_yarn_cache:/home/developer/.cache/yarn
volumes:
db:
seed:
hitobito_bundle:
external: true
hitobito_yarn_cache:
external: true
sphinx_indexes:
Ich kriege das Docker-Compose nicht zum laufen.
Beim Sphinx Container kriege ich folgende Error-Meldung:
cevi-sphinx-1 | Host OS is Linux alpine38 4.14.69-0-vanilla #1-Alpine SMP Mon Sep 10 19:33:23 UTC 2018 x86_64 Linux
cevi-sphinx-1 | Stack bottom = 0x4001ffacd7, thread stack size = 0x20000
cevi-sphinx-1 | Trying manual backtrace:
cevi-sphinx-1 | Something wrong with thread stack, manual backtrace may be incorrect (fp=0x5)
cevi-sphinx-1 | Wrong stack limit or frame pointer, manual backtrace failed (fp=0x5, stack=0x4002000000, stacksize=0x20000)
cevi-sphinx-1 | -------------- backtrace ends here ---------------
cevi-sphinx-1 | Please, create a bug report in our bug tracker (http://sphinxsearch.com/bugs) and attach there:
cevi-sphinx-1 | a) searchd log, b) searchd binary, c) searchd symbols.
cevi-sphinx-1 | Look into the chapter 'Reporting bugs' in the documentation
cevi-sphinx-1 | (/usr/share/doc/sphinx/sphinx.txt or http://sphinxsearch.com/docs/current.html#reporting-bugs)
cevi-sphinx-1 | --- BT to source lines (depth 0): ---
cevi-sphinx-1 | conversion failed (error 'No such file or directory'):
cevi-sphinx-1 | 1. Run the command provided below over the crashed binary (for example, 'searchd'):
cevi-sphinx-1 | 2. Attach the source.txt to the bug report.
cevi-sphinx-1 | addr2line -e searchd > source.txt
cevi-sphinx-1 | --- BT to source lines finished ---
cevi-sphinx-1 | --- 0 active threads ---
cevi-sphinx-1 | ------- CRASH DUMP END -------
cevi-worker-1 | ⚙ Activating Wagonfile.development
Beim Rails Container kriege ich diese Meldung:
cevi-rails-1 | Creating scope :without_deleted. Overwriting existing method Role.without_deleted.
cevi-rails-1 | Creating scope :with_deleted. Overwriting existing method Role.with_deleted.
cevi-rails-1 | Creating scope :only_deleted. Overwriting existing method Role.only_deleted.
cevi-rails-1 | /usr/src/app/hitobito_cevi/lib/hitobito_cevi/wagon.rb:49: warning: already initialized constant AbilityDsl::UserContext::LAYER_PERMISSIONS
cevi-rails-1 | /usr/src/app/hitobito/app/abilities/ability_dsl/user_context.rb:16: warning: previous definition of LAYER_PERMISSIONS was here
cevi-rails-1 | /usr/src/app/hitobito_cevi/lib/hitobito_cevi/wagon.rb:50: warning: already initialized constant AbilityDsl::UserContext::GROUP_PERMISSIONS
cevi-rails-1 | /usr/src/app/hitobito/app/abilities/ability_dsl/user_context.rb:12: warning: previous definition of GROUP_PERMISSIONS was here
cevi-rails-1 | /usr/src/app/hitobito_cevi/lib/hitobito_cevi/wagon.rb:58: warning: already initialized constant Export::Tabular::Groups::List::EXCLUDED_ATTRS
cevi-rails-1 | /usr/src/app/hitobito/app/domain/export/tabular/groups/list.rb:11: warning: previous definition of EXCLUDED_ATTRS was here
cevi-rails-1 | Function not implemented - Failed to initialize inotify excluded from capture: DSN not set
cevi-rails-1 | rails aborted!
cevi-rails-1 | Errno::ENOSYS: Function not implemented - Failed to initialize inotify
cevi-rails-1 | /usr/src/app/hitobito/config/environment.rb:5:in `<main>'
cevi-rails-1 | Tasks: TOP => db:migrate => db:load_config => environment
cevi-rails-1 | (See full trace by running task with --trace)
cevi-rails-1 exited with code 1
Hat das überhaupt was mit m1 oder mac zu tun, oder eher nicht?
Try setup hitobito on a brand new clear ubuntu installation.
when running docker-compose run rails rails db:seed wagon:seed
got errors bundle install.
Running bundle install
Fetching gem metadata from https://rubygems.org/.........
Bundler::PermissionError: There was an error while trying to write to
/opt/bundle/cache. It is likely that you need to grant write permissions for
that path.
An error occurred while installing rake (13.0.1), and Bundler
cannot continue.
Make sure that gem install rake -v '13.0.1' --source https://rubygems.org/
succeeds before bundling.
In Gemfile:
activerecord-session_store was resolved to 1.1.3, which depends on
railties was resolved to 6.0.3.2, which depends on
rake
`
Any ideas?
our development docker image is currently based on centos which brings pretty old mysql libs with it. this causes unwanted changes for schema.rb and also creates annoying changes for the annotation in model class files.
we're working on a new ruby image for running our rails apps in production. it probably makes sense to use this image in this development setup. so if this image is updated, annotate can probably just be re-enabled.
Manche Mailings funktionieren im Docker nicht, im Test & Prod aber schon.
Bsp. wenn sich ein TN an einem Kurs anmeldet, sollte eine Anmelde-Bestätigung gesendet werden. Funktioniert im Docker nicht.
Bsp. Abmeldung von einem Kurs klappt.
Stacktrace vom Bsp:
[Worker(host:fe5fa172288a pid:1)] Job Event::ApprovalRequestJob (id=187) FAILED (6 prior attempts) with ActionController::UrlGenerationError: No route matches {:action=>"show", :controller=>"event/participations", :event_id=>#<Event::Participation id: 1260, event_id: 121, person_id: 449, additional_information: nil, created_at: "2020-09-27 13:20:48", updated_at: "2020-09-27 13:20:48", active: true, application_id: 248, qualified: nil, canceled_at: nil, state: "assigned", bsv_days: nil>, :group_id=>#<Event::Course id: 121, type: "Event::Course", name: "BKPS 701", number: "701", motto: "Voluptas velit odit nulla provident et sunt non mo...", cost: nil, maximum_participants: 24, contact_id: nil, description: "Repellendus recusandae nulla quo libero quos fugit...", location: "Karl-Jaspers-Str. 2\n79100\nVeraland", application_opening_at: "2020-12-21", application_closing_at: "2021-02-19", application_conditions: nil, kind_id: 3, state: "closed", priorization: true, requires_approval: true, created_at: "2020-09-27 13:20:47", updated_at: "2020-09-27 13:20:48", participant_count: 0, application_contact_id: nil, external_applications: true, applicant_count: 2, teamer_count: 5, signature: true, signature_confirmation: nil, signature_confirmation_text: nil, creator_id: nil, updater_id: nil, applications_cancelable: false, required_conta [], hidden_contact_attrs: [], display_booking_info: true, training_days: nil, tentative_applications: false, language_de: false, language_fr: false, language_it: false, language_en: false, express_fee: nil, requires_approval_abteilung: true, requires_approval_region: false, requires_approval_kantonalverband: false, requires_approval_bund: false, expected_participants_wolf_f: nil, expected_participants_wolf_m: nil, expected_participants_pfadi_f: nil, expected_participants_pfadi_m: nil, expected_participants_pio_f: nil, expected_participants_pio_m: nil, expected_participants_rover_f: nil, expected_participants_rover_m: nil, expected_participants_leitung_f: nil, expected_participants_leitung_m: nil, canton: nil, coordinates: nil, altitude: nil, emergency_phone: nil, landlord: nil, landlord_permission_obtained: false, j_s_kind: nil, j_s_security_snow: false, j_s_security_mountain: false, j_s_security_water: false, participants_can_apply: false, participants_can_cancel: false, al_present: false, al_visiting: false, al_visiting_date: nil, coach_visiting: false, coach_visiting_date: nil, coach_confirmed: false, local_scout_contact_present: false, local_scout_contact: nil, camp_reminder_sent: false, paper_application_required: false, lagerreglement_applied: false, kantonalverband_rules_applied: false, j_s_rules_applied: false, bsv_days: nil, camp_submitted_at: nil, has_confirmations: true, parent_id: nil, allow_sub_camps: false, lft: 241, rgt: 242, contact_attrs_passed_on_to_supercamp: nil>, :locale=>#<Group::Abteilung id: 16, parent_id: 9, lft: 74, rgt: 75, name: "Chräis Chäib", short_name: nil, type: "Group::Abteilung", email: "[email protected]", address: "Bohnenkampsweg 56b", zip_code: 3189, town: "West Corinna", country: nil, contact_id: nil, created_at: "2020-09-27 13:17:13", updated_at: "2020-09-27 13:17:13", deleted_at: nil, layer_group_id: 16, creator_id: nil, updater_id: nil, deleter_id: nil, require_person_add_requests: false, description: nil, logo: nil, pta: false, vkp: false, pbs_material_insurance: false, website: nil, pbs_shortname: nil, bank_account: nil, application_approver_role: nil, gender: nil, try_out_day_at: nil, group_health: false>}, missing required keys: [:id]
While following along the instructions of the README on macOS 10.15.7, I hit this exact issue:
Shopify/bootsnap#353
More precisely, any of the containers rails
, webpack
or worker
could fail with this log output:
...
rails_1 | Bundle complete! 113 Gemfile dependencies, 254 gems now installed.
rails_1 | Bundled gems are installed into `/opt/bundle`
rails_1 | ⚙️ Testing DB connection
rails_1 | ✅ DB server is ready
rails_1 | ⚙️ Performing migrations
rails_1 | rails aborted!
rails_1 | Errno::EPERM: Operation not permitted - bs_fetch:atomic_write_cache_file:chmod
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:37:in `fetch'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:37:in `load_iseq'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails/engine.rb:4:in `<main>'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails/application.rb:11:in `<main>'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails.rb:14:in `<main>'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails/all.rb:5:in `<main>'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
rails_1 | /usr/src/app/hitobito/config/application.rb:8:in `<main>'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
rails_1 | /usr/src/app/hitobito/rakefile:12:in `<main>'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `block in load'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:318:in `load'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails/commands/rake/rake_command.rb:22:in `block in perform'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails/commands/rake/rake_command.rb:20:in `perform'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails/command.rb:48:in `invoke'
rails_1 | /opt/bundle/gems/railties-6.0.3.4/lib/rails/commands.rb:18:in `<main>'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
rails_1 | /opt/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
rails_1 | /opt/bundle/gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
rails_1 | bin/rails:4:in `<main>'
rails_1 | (See full trace by running task with --trace)
pbs_rails_1 exited with code 1
When executing rails spec:features
locally within the rails-test
container, the database is reset and tests will fail with the error Unknown column 'people.title' in 'field list'
(with generic wagon). In fact the database does no more contain changes from the wagon migrations.
I've been able to make it work, by removing the :test
group from the Wagonfile
.
Is this the solution? Or how can this be fixed otherwise?
-> This should be documented.
It is not currently possible to open a rails console quickly as follows:
# neither this...
docker-compose exec rails rails c
# ... not this works
docker-compose exec rails bash -c "rails c"
The reason is that rails is not on $PATH until ~/.bashrc
runs. Could we maybe add /opt/app-root/src/hitobito/bin to PATH in e.g. the Dockerfile or docker-compose.yml? (and probably the same for unsetting the APP_ROOT env variable)
Workaround for now is to open bash and then open the rails console:
docker-compose exec rails bash
rails c
To debug or write feature specs, it is absolutely necessary to execute them in a non-headless browser. Generally, to do this, the HEADLESS=false
environment variable can be set. With the current container setup it is not possible to execute the features specs in this mode – a solution has to be engineered and documented.
Work around:
app/hitobito
, use the following command to execute one or more feature specs in non-headless mode (Ruby/Bundler must be available, Gems installed):RAILS_HOST_NAME=localhost:3000 RAILS_DB_ADAPTER=mysql2 RAILS_DB_HOST=127.0.0.1 RAILS_DB_PORT=33066 RAILS_DB_USERNAME=root RAILS_DB_PASSWORD=hitobito RAILS_DB_NAME=hitobito_test HEADLESS=false bundle exec rspec --tag type:feature spec/features/
See also #7
I managed to get everything up and running, and I currently want to test the mail features out (abo).
However, the email-adress is something like ...@localhost (which makes sense).
Mailcatcher does only catch incoming mails, which are sent for example when a user want's a password reset link. This does work.
However, is there a way to send a mail to the running hitobito application for it to be sent to the abo mailing lists?
Hallo zusammen
Ich würde gerne die Specs im PBS Wagon zum laufen bringen (und dann anpassen). Aber ich scheitere schon beim Ausführen der Anleitung. Hat jemand einen Tipp?
michael/workspace/hitobito$ export WAGON=pbs
michael/workspace/hitobito$ bin/test_env_wagon bundle exec rspec
Creating hitobito_rails_run ... done
⚙ Activating Wagonfile.development
Installing gems if necessary
⚙️ Testing DB connection
✅ DB server is ready
⚙️ Performing migrations
/opt/bundle/ruby/2.7.0/gems/pry-byebug-3.7.0/lib/pry-byebug/control_d_handler.rb:5: warning: control_d_handler's arity of 2 parameters was deprecated (eval_string, pry_instance). Now it gets passed just 1 parameter (pry_instance)
/usr/src/app/hitobito/config/initializers/person_language.rb:2: warning: already initialized constant Person::PUBLIC_ATTRS
/usr/src/app/hitobito/app/models/person.rb:67: warning: previous definition of PUBLIC_ATTRS was here
The database schema will not be dumped when there are loaded wagon migrations.
To dump the application schema, please 'rake wagon:remove WAGON=ALL' wagons beforehand or reset the database.
✅ Migrations done
↪️ Skipping seeding because already done on Tue Jan 4 15:48:03 UTC 2022
⚙️ Executing: bundle exec bash bundle exec rspec
/usr/local/bundle/bin/bundle: line 9: require: command not found
/usr/local/bundle/bin/bundle: line 11: version: command not found
/usr/local/bundle/bin/bundle: line 13: str: command not found
/usr/local/bundle/bin/bundle: bundle: line 15: syntax error near unexpected token `('
/usr/local/bundle/bin/bundle: bundle: line 15: ` str = str.b[/\A_(.*)_\z/, 1]'
michael/workspace/hitobito$
Hallo,
ich bin gerade dabei mir eine lokale Instanz zu erstellen, aber der Webserver scheint nicht zu starten.
Name Command State Ports
verein_cache_1 docker-entrypoint.sh memca ... Up 11211/tcp
verein_db_1 docker-entrypoint.sh --sor ... Up 0.0.0.0:33066->3306/tcp,:::33066->3306/tcp, 33060/tcp
verein_mailcatcher_1 mailcatcher -f --ip 0.0.0.0 Up 0.0.0.0:1080->1080/tcp,:::1080->1080/tcp
verein_rails_1 rails-entrypoint.sh rails ... Exit 1
verein_rails_test_core_1 rails-entrypoint.sh sleep ... Exit 1
verein_sphinx_1 sphinx-start Exit 2
verein_webpack_1 webpack-entrypoint.sh /usr ... Up 0.0.0.0:3035->3035/tcp,:::3035->3035/tcp
verein_worker_1 rails-entrypoint.sh rails ... Exit 1
Es ist ein ganz frisches debian 12, nach Anleitung hier eingerichtet.
Vielleicht jemand eine Ahnung, was das sein kann?
Danke :)
Hallo zusammen
Nach dem Herunterziehen der neusten Code-Basis hat mein Setup nicht mehr geklappt. Ich habe dann einiges probiert (Docker Images gelöscht, usw.), jedoch alles ohne Erfolg. Am Schluss habe ich das ganze Setup neu "nach Anleitung" gemacht. Doch auch so lande ich wieder beim gleichen Fehler von Webpacker.
Sind die Instructions vielleicht nicht mehr aktuell? Oder habe ich etwas verpasst?
Merci für die Hilfe!
Rails.root: /usr/src/app/hitobito
Application Trace | Framework Trace | Full Trace
webpacker (5.2.1) lib/webpacker/manifest.rb:79:in `handle_missing_entry'
webpacker (5.2.1) lib/webpacker/manifest.rb:49:in `lookup!'
webpacker (5.2.1) lib/webpacker/helper.rb:193:in `rescue in resolve_path_to_image'
webpacker (5.2.1) lib/webpacker/helper.rb:189:in `resolve_path_to_image'
app/helpers/webpack_helper.rb:19:in `wagon_image_pack_path'
app/helpers/webpack_helper.rb:38:in `wagon_favicon_pack_tag'
app/views/layouts/application.html.haml:16
actionview (6.1.4.1) lib/action_view/base.rb:247:in `public_send'
actionview (6.1.4.1) lib/action_view/base.rb:247:in `_run'
actionview (6.1.4.1) lib/action_view/template.rb:154:in `block in render'
activesupport (6.1.4.1) lib/active_support/notifications.rb:205:in `instrument'
actionview (6.1.4.1) lib/action_view/template.rb:345:in `instrument_render_template'
actionview (6.1.4.1) lib/action_view/template.rb:152:in `render'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:72:in `block in render_with_layout'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:70:in `render_with_layout'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:55:in `render_template'
actionview (6.1.4.1) lib/action_view/renderer/template_renderer.rb:11:in `render'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
actionview (6.1.4.1) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (6.1.4.1) lib/action_view/rendering.rb:117:in `block in _render_template'
actionview (6.1.4.1) lib/action_view/base.rb:273:in `in_rendering_context'
actionview (6.1.4.1) lib/action_view/rendering.rb:116:in `_render_template'
actionpack (6.1.4.1) lib/action_controller/metal/streaming.rb:218:in `_render_template'
actionview (6.1.4.1) lib/action_view/rendering.rb:103:in `render_to_body'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (6.1.4.1) lib/action_controller/metal/renderers.rb:142:in `render_to_body'
actionpack (6.1.4.1) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
/usr/local/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
activesupport (6.1.4.1) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:46:in `block in render'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:86:in `cleanup_view_runtime'
activerecord (6.1.4.1) lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:45:in `render'
remotipart (1.3.1) lib/remotipart/render_overrides.rb:16:in `render_with_remotipart'
app/controllers/concerns/decorates_before_rendering.rb:35:in `render'
responders (3.0.0) lib/action_controller/responder.rb:240:in `default_render'
responders (3.0.0) lib/action_controller/responder.rb:172:in `to_html'
responders (3.0.0) lib/action_controller/responder.rb:165:in `respond'
responders (3.0.0) lib/action_controller/responder.rb:158:in `call'
responders (3.0.0) lib/action_controller/respond_with.rb:213:in `respond_with'
devise (4.7.1) app/controllers/devise/sessions_controller.rb:14:in `new'
actionpack (6.1.4.1) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.1.4.1) lib/abstract_controller/base.rb:228:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.1.4.1) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:117:in `block in run_callbacks'
actiontext (6.1.4.1) lib/action_text/rendering.rb:20:in `with_renderer'
actiontext (6.1.4.1) lib/action_text/engine.rb:59:in `block (4 levels) in <class:Engine>'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `instance_exec'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sentry-raven (2.11.0) lib/raven/integrations/rails/controller_transaction.rb:7:in `block in included'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `instance_exec'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:126:in `block in run_callbacks'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:137:in `run_callbacks'
actionpack (6.1.4.1) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `block in instrument'
activesupport (6.1.4.1) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.1.4.1) lib/active_support/notifications.rb:203:in `instrument'
actionpack (6.1.4.1) lib/action_controller/metal/instrumentation.rb:33:in `process_action'
actionpack (6.1.4.1) lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
activerecord (6.1.4.1) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.1.4.1) lib/abstract_controller/base.rb:165:in `process'
actionview (6.1.4.1) lib/action_view/rendering.rb:39:in `process'
actionpack (6.1.4.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.1.4.1) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.1.4.1) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.1.4.1) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.1.4.1) lib/action_dispatch/routing/route_set.rb:842:in `call'
bullet (6.1.5) lib/bullet/rack.rb:15:in `call'
http_accept_language (2.1.0) lib/http_accept_language/middleware.rb:14:in `call'
remotipart (1.3.1) lib/remotipart/middleware.rb:32:in `call'
warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
warden (1.2.8) lib/warden/manager.rb:34:in `catch'
warden (1.2.8) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/deflater.rb:44:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
actionpack (6.1.4.1) lib/action_dispatch/http/permissions_policy.rb:22:in `call'
actionpack (6.1.4.1) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (6.1.4.1) lib/active_record/migration.rb:601:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.1.4.1) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
airbrake (12.0.0) lib/airbrake/rack/middleware.rb:34:in `call!'
airbrake (12.0.0) lib/airbrake/rack/middleware.rb:23:in `call'
better_errors (2.8.0) lib/better_errors/middleware.rb:62:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.1.4.1) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `block in tagged'
activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:37:in `tagged'
activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `tagged'
railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
request_store (1.5.0) lib/request_store/middleware.rb:19:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (6.1.4.1) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/static.rb:24:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.1.4.1) lib/action_dispatch/middleware/host_authorization.rb:92:in `call'
sentry-raven (2.11.0) lib/raven/integrations/rack.rb:51:in `call'
rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'
webpacker (5.2.1) lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (6.1.4.1) lib/rails/engine.rb:539:in `call'
railties (6.1.4.1) lib/rails/railtie.rb:207:in `public_send'
railties (6.1.4.1) lib/rails/railtie.rb:207:in `method_missing'
puma (4.3.9) lib/puma/configuration.rb:228:in `call'
puma (4.3.9) lib/puma/server.rb:718:in `handle_request'
puma (4.3.9) lib/puma/server.rb:472:in `process_client'
puma (4.3.9) lib/puma/server.rb:328:in `block in run'
puma (4.3.9) lib/puma/thread_pool.rb:134:in `block in spawn_thread'
Toggle env dump
GATEWAY_INTERFACE: "CGI/1.2"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
HTTP_ACCEPT_ENCODING: "gzip, deflate, br"
HTTP_ACCEPT_LANGUAGE: "en-US,en;q=0.9"
HTTP_VERSION: "HTTP/1.1"
ORIGINAL_SCRIPT_NAME: ""
REMOTE_ADDR: "172.19.0.1"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"
currently sphinx is started as container, but search does not use sphinx since the env variable RAILS_SPHINX_PORT is not set by default. Setting RAILS_SPHINX_PORT=9312 in docker/rails.env activates it and it works.
currently sphinx is just using a static index config: https://github.com/hitobito/development/blob/master/docker/sphinx.conf
so only core attributes are searchable and extended indexes from the wagons are ignored
the goal is to generate the sphinx dynamically on start-up (docker-compose up) with thinking_sphinx gem
die sphinx tests können aktuell noch nicht im rails-test container ausgeführt werden.
rspec --tag sphinx:true spec/domain/search_strategies/sphinx_spec.rb
/opt/rh/rh-ruby26/root/usr/share/ruby/irb/input-method.rb:16: warning: already initialized constant IRB::STDIN_FILE_NAME
/opt/rh/rh-ruby26/root/usr/share/gems/gems/irb-1.0.0/lib/irb/input-method.rb:16: warning: previous definition of STDIN_FILE_NAME was here
ruby/2.6.2 isn't supported by this pry-doc version
Run options:
include {:sphinx=>true}
exclude {:type=>"feature", :performance=>true, :format=>:json}
Randomized with seed 57555
sh: indexer: command not found
Fsh: indexer: command not found
Fsh: indexer: command not found
ggf. entwickler doku im core noch ergänzen (habe gerade keine doku zum ausführen von sphinx test gefunden)
Hi there,
I tried to run your docker compose (docker-compose run rails 'rails db:seed wagon:seed') in order to build a dev environment but get the following error:
### Dependency Installed:
libtool-ltdl.x86_64 0:2.4.2-22.el7_3 unixODBC.x86_64 0:2.3.1-14.el7
Complete!
: No such file or directory
ERROR: Service 'webpack' failed to build : The command '/bin/sh -c yum localinstall -y "https://github.com/sphinxsearch/sphinx/releases/download/2.2.11-release/sphinx-2.2.11-1.rhel7.x86_64.rpm" && scl enable rh-ruby26 install-nodejs && yum install -y python-setuptools && scl enable rh-ruby26 install-transifex && yum install ImageMagick ImageMagick-devel -y' returned a non-zero code: 127
My building workstation is running Windows 10 + WSL 2 + Docker for Windows.
See full output in the file
Hi!
I was wondering on how it is possible to get the login credentials for hitobito set up with this repository, because no credentials are posted somewhere.
On the setup side, this works perfectly, thank you very much!
@Michael-Schaer commented on Sun Sep 27 2020
Beim Testen des MailChimp-Exportes in meiner Entwicklungsumgebung (ohne Änderungen) ist mir folgendes aufgefallen:
Wenn die Option "Alle Versandadressen synchronisieren" aktiviert ist, schlägt der Export fehl (der Status auf dem Abo wird als "Fehlgeschlagen" angezeigt).
Auf Produktion und im Integrationssystem der PBS scheint dies nicht der Fall zu sein. Ich frage mich darum, ob sich die Code-Basis verändert hat oder die Dev-Umgebung etwas anders macht als die Int und Prod Instanzen.
@kronn commented on Wed Jan 13 2021
WIr haben am 2020-08-27 eine Default-Einstellung geändert. Seither wird im Development-Setup nicht mehr der Mailchimp-Export ausgeführt. Dies soll verhindern, dass man versehentlich beim Debuggen mit produktiven Daten mit Mailchimp kommuniziert.
Das Setting ist in config/settings/development.yml
und sollte in config/settings/development.local.yml
überschrieben werden, wenn man es braucht.
Das hier sollte helfen:
# config/settings/development.local.yml
mailchimp:
enabled: true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.