getlago / lago-api

Open Source Metering and Usage Based Billing
https://www.getlago.com/
GNU Affero General Public License v3.0
333 stars 99 forks source link

[BUG]: Upgrade to 1.6.0 fails to fetch invoices #2241

Open markandpathak opened 3 months ago

markandpathak commented 3 months ago

When we upgraded to 1.6.0 from 1.5.1 the invoices page stopped fetching invoices. In the api logs following errors were produced:

E, [2024-07-03T06:31:06.310689 #16] ERROR -- : [d16f0b4a-9123-49ef-9cbb-dc0a457c468c]   

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] RuntimeError (              Failed to implement Invoice.paymentOverdue, tried:

              - `Types::Invoices::Object#payment_overdue`, which did not exist

              - `Invoice#payment_overdue`, which did not exist

              - Looking up hash key `:payment_overdue` or `"payment_overdue"` on `#<Invoice:0x0000f2a212b92588>`, but it wasn't a Hash

              To implement this field, define one of the methods above (and check for typos), or supply a `fallback_value`.

):

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c]   

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/schema/field.rb:712:in `block (2 levels) in resolve'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/schema/field.rb:806:in `with_extensions'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/schema/field.rb:657:in `block in resolve'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/schema.rb:1023:in `after_lazy'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/schema/field.rb:655:in `resolve'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:502:in `block (3 levels) in evaluate_selection_with_args'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/tracing.rb:65:in `trace'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:501:in `block (2 levels) in evaluate_selection_with_args'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:826:in `call_method_on_directives'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:498:in `block in evaluate_selection_with_args'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:925:in `after_lazy'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:436:in `evaluate_selection_with_args'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:425:in `evaluate_selection'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/execution/interpreter/runtime.rb:358:in `block (2 levels) in evaluate_selections'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/dataloader.rb:181:in `block in run'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] graphql (2.0.11) lib/graphql/dataloader.rb:303:in `block in spawn_fiber'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] newrelic_rpm (9.5.0) lib/new_relic/agent/tracer.rb:435:in `block (2 levels) in thread_block_with_current_transaction'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] newrelic_rpm (9.5.0) lib/new_relic/agent/tracer.rb:357:in `capture_segment_error'

[d16f0b4a-9123-49ef-9cbb-dc0a457c468c] newrelic_rpm (9.5.0) lib/new_relic/agent/tracer.rb:434:in `block in thread_block_with_current_transaction'

After reverting back to v1.5.1 everything started working again

To Reproduce

  1. Create some invoice with stack deployed with v1.5.1
  2. Upgrade the stack to 1.6.0
  3. Go to the invoices page

Expected behavior The migration to newer version should not result in invoices being inaccessible

Support

bumi commented 2 months ago

Same here, with the same error. but we started with a fresh db in v 1.6.0

jdenquin commented 2 months ago

can you try with the last 1.6.4 version ?