Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker exec -it rails bash -c "bin/rake db:reset" can fail with Validation failed: Cityname is too long #10587

Open
lgarron opened this issue Jan 9, 2025 · 0 comments

Comments

@lgarron
Copy link
Member

lgarron commented Jan 9, 2025

Ran into this while debugging #10586

Describe the bug

docker exec -it rails bash -c "bin/rake db:reset" can fail with Validation failed: Cityname is too long

To Reproduce

  1. Launch a codespace at https://github.com/thewca/worldcubeassociation.org/codespaces
  2. Run commands from the quickstart guide (https://docs.worldcubeassociation.org/contributing/quickstart.html):
# In one shell
docker-compose up
# In another shell once the first shell is showing stable output
docker exec -it rails bash -c "bin/rake db:reset"

Expected behavior

No failure

Screenshots

╭─── /workspaces/worldcubeassociation.org ────────────────────────────────────────────────────────
├─  lgarron/main  | ✔ 
├─ codespace@codespaces-ea4547
│ docker exec -it rails bash -c "bin/rake db:reset"
┴
warning: parser/current is loading parser/ruby33, which recognizes 3.3.6-compliant syntax, but you are running 3.3.5.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Running via Spring preloader in process 367
Dropped database 'wca_development'
Dropped database 'wca_test'
Created database 'wca_development'
Created database 'wca_test'
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Cityname is too long (maximum is 50 characters) (ActiveRecord::RecordInvalid)
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/validations.rb:87:in `raise_validation_error'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/validations.rb:54:in `save!'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/transactions.rb:366:in `block in save!'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/transactions.rb:418:in `block (2 levels) in with_transaction_returning_status'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/transactions.rb:414:in `block in with_transaction_returning_status'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `with_connection'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/transactions.rb:410:in `with_transaction_returning_status'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/transactions.rb:366:in `save!'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/suppressor.rb:56:in `save!'
/app/db/seeds/development/competitions.seeds.rb:195:in `block (2 levels) in evaluate'
/app/db/seeds/development/competitions.seeds.rb:166:in `block in evaluate'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/seedbank-0.5.0/lib/seedbank/runner.rb:31:in `after'
/app/db/seeds/development/competitions.seeds.rb:3:in `evaluate'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/seedbank-0.5.0/lib/seedbank/runner.rb:51:in `instance_eval'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/seedbank-0.5.0/lib/seedbank/runner.rb:51:in `evaluate'
/usr/local/bundle/3.3.5/ruby/3.3.0/gems/seedbank-0.5.0/lib/seedbank/dsl.rb:32:in `block in define_seed_task'
<internal:/usr/local/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
<internal:/usr/local/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
-e:1:in `<main>'
Tasks: TOP => db:seed:development:competitions:body
(See full trace by running task with --trace)
┬
├─ ❌ [1] command status
╰─── ⏱️ 248.166s ────────────────────────────────────────────────────────────────────────────────

Desktop (please complete the following information):

  • OS: macOS 15.2
  • Browser: Chrome 131.0.6778.265
  • Version: eb7f6943db242ec1c7a309f192d3baef88b9ab94 (tip-of-tree on main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant