maybe-finance / maybe

The OS for your personal finances
https://maybe.co
GNU Affero General Public License v3.0
29.53k stars 2.25k forks source link

Bug: GoodJob error: ActiveModel::UnknownAttributeError: unknown attribute 'process_id' for GoodJob::Execution. #971

Closed mistadikay closed 2 months ago

mistadikay commented 2 months ago

Describe the bug Hi, I'm trying to self-host Maybe on my home server and after initial setup I noticed that my free space is running out. I then discovered it produced a 190G file with logs. See details below

To Reproduce I was not able to reproduce it again after clean install, but here is what I did originally:

  1. Create a docker-compose.yml with the following content (got it from https://raw.githubusercontent.com/maybe-finance/maybe/main/docker-compose.example.yml):
    services:
    app:
    image: ghcr.io/maybe-finance/maybe:latest
    volumes:
      - app-storage:/rails/storage
    ports:
      - 3000:3000
    restart: unless-stopped
    environment:
      SELF_HOSTING_ENABLED: "true"
      RAILS_FORCE_SSL: "false"
      RAILS_ASSUME_SSL: "false"
      GOOD_JOB_EXECUTION_MODE: async
      SECRET_KEY_BASE: ${SECRET_KEY_BASE:?}
      DB_HOST: postgres
      POSTGRES_DB: ${POSTGRES_DB:-maybe_production}
      POSTGRES_USER: ${POSTGRES_USER:-maybe_user}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?}
    depends_on:
      postgres:
        condition: service_healthy
    postgres:
    image: postgres:16
    restart: unless-stopped
    volumes:
      - postgres-data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-maybe_user}
      POSTGRES_DB: ${POSTGRES_DB:-maybe_production}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?}
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
      interval: 5s
      timeout: 5s
      retries: 5
    volumes:
    app-storage:
    postgres-data:
  2. Create .env file with content such as:
    SECRET_KEY_BASE="9a6392f1bb9f..."
    POSTGRES_PASSWORD="rp4bUCvu..."
  3. Run docker-compose up
  4. Create an account
  5. Add a credit card with 0 balance (if I remember correctly)

Expected behavior No such errors

Screenshots / Recordings

Error messages are of this nature:

maybe-app-1       | E, [2024-07-10T16:49:26.294671 #1] ERROR -- : [GoodJob] GoodJob error: ActiveModel::UnknownAttributeError: unknown attribute 'process_id' for GoodJob::Execution.
maybe-app-1       |  ["/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activemodel/lib/active_model/attribute_assignment.rb:53:in `rescue in _assign_attribute'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activemodel/lib/active_model/attribute_assignment.rb:46:in `_assign_attribute'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/attribute_assignment.rb:15:in `block in _assign_attributes'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/attribute_assignment.rb:9:in `each'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/attribute_assignment.rb:9:in `_assign_attributes'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activemodel/lib/active_model/attribute_assignment.rb:34:in `assign_attributes'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activemodel/lib/active_model/api.rb:81:in `initialize'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/core.rb:458:in `initialize'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/inheritance.rb:76:in `new'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/inheritance.rb:76:in `new'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/reflection.rb:183:in `build_association'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/associations/association.rb:354:in `build_record'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/associations/collection_association.rb:356:in `_create_record'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/associations/has_many_association.rb:147:in `_create_record'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/associations/association.rb:210:in `create!'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/associations/collection_proxy.rb:366:in `create!'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/base_execution.rb:446:in `block (3 levels) in perform'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/transactions.rb:234:in `block in transaction'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:407:in `with_connection'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/connection_handling.rb:296:in `with_connection'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/transactions.rb:233:in `transaction'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/transactions.rb:354:in `transaction'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/base_execution.rb:430:in `block (2 levels) in perform'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/lib/good_job/current_thread.rb:113:in `within'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/base_execution.rb:408:in `block in perform'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activesupport/lib/active_support/callbacks.rb:121:in `block in run_callbacks'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/batch.rb:78:in `within_thread'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/base_execution.rb:610:in `reset_batch_values'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activesupport/lib/active_support/callbacks.rb:130:in `block in run_callbacks'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activesupport/lib/active_support/callbacks.rb:141:in `run_callbacks'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/base_execution.rb:402:in `perform'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/base_execution.rb:312:in `block in perform_with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/concerns/good_job/advisory_lockable.rb:172:in `block in with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation.rb:1355:in `_scoping'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation.rb:541:in `scoping'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/scoping/default.rb:51:in `unscoped'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/concerns/good_job/advisory_lockable.rb:172:in `with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation/delegation.rb:78:in `block in with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation.rb:1355:in `_scoping'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation.rb:541:in `scoping'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation/delegation.rb:78:in `with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/app/models/good_job/base_execution.rb:306:in `perform_with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation/delegation.rb:78:in `block in perform_with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation.rb:1355:in `_scoping'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation.rb:541:in `scoping'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activerecord/lib/active_record/relation/delegation.rb:78:in `perform_with_advisory_lock'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/lib/good_job/job_performer.rb:35:in `block in next'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/lib/good_job/capsule_tracker.rb:103:in `register'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/lib/good_job/job_performer.rb:34:in `next'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/lib/good_job/scheduler.rb:276:in `block (2 levels) in create_task'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activesupport/lib/active_support/reloader.rb:77:in `block in wrap'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activesupport/lib/active_support/execution_wrapper.rb:91:in `wrap'", "/usr/local/bundle/ruby/3.3.0/bundler/gems/rails-8075866ae8df/activesupport/lib/active_support/reloader.rb:74:in `wrap'", "/usr/local/bundle/ruby/3.3.0/gems/good_job-4.0.0/lib/good_job/scheduler.rb:275:in `block in create_task'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `block in synchronize'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/ivar.rb:170:in `safe_execute'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/scheduled_task.rb:298:in `process_task'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/timer_set.rb:98:in `block in ns_post_task'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in `run_task'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in `block (3 levels) in create_worker'", "<internal:kernel>:187:in `loop'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in `block (2 levels) in create_worker'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `catch'", "/usr/local/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `block in create_worker'"]

Additional context system: Ubuntu Server 24.04 LTS

zachgoll commented 2 months ago

@mistadikay could you try pulling in the latest changes from main? I think #967 should fix this for you.

mistadikay commented 2 months ago

@zachgoll Seems to be working fine now :+1:

zachgoll commented 2 months ago

@mistadikay awesome! If you have an issue with logs again feel free to open another issue for that. Otherwise I think we can close this one out.