Skip to content

PG::RestrictViolation on node_functions from sub_flows #1254

Description

@Taucher2003
PG::RestrictViolation: ERROR:  update or delete on table \"node_functions\" violates RESTRICT setting of foreign key constraint \"fk_rails_e27dd4d82a\" on table \"sub_flows\"\nDETAIL:  Key (id)=(16) is referenced from table \"sub_flows\".
{
  "severity": "ERROR",
  "time": "2026-08-25T20:42:25.131Z",
  "message": "PG::RestrictViolation: ERROR:  update or delete on table \"node_functions\" violates RESTRICT setting of foreign key constraint \"fk_rails_e27dd4d82a\" on table \"sub_flows\"\nDETAIL:  Key (id)=(16) is referenced from table \"sub_flows\".\n",
  "backtrace": [
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'PG::Connection#exec'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:167:in 'ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements#perform_query'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:571:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:1086:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'",
    "/usr/local/bundle/ruby/3.4.0/gems/activesupport-8.1.3.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:1055:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:570:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'",
    "/usr/local/bundle/ruby/3.4.0/gems/activesupport-8.1.3.1/lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:1206:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#log'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:569:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:613:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#internal_execute'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:169:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#exec_delete'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:217:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#delete'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/query_cache.rb:25:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#delete'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/persistence.rb:296:in 'block in ActiveRecord::Persistence::ClassMethods#_delete_record'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:457:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_handling.rb:313:in 'ActiveRecord::ConnectionHandling#with_connection'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/persistence.rb:295:in 'ActiveRecord::Persistence::ClassMethods#_delete_record'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/persistence.rb:902:in 'ActiveRecord::Persistence#_delete_row'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/persistence.rb:440:in 'ActiveRecord::Persistence#delete'",
    "/sagittarius/app/services/namespaces/projects/flows/delete_service.rb:22:in 'block in Namespaces::Projects::Flows::DeleteService#execute'",
    "/sagittarius/lib/sagittarius/database/transactional.rb:18:in 'block in Sagittarius::Database::Transactional#transactional'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:648:in 'block in ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction'",
    "/usr/local/bundle/ruby/3.4.0/gems/activesupport-8.1.3.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/transaction.rb:645:in 'ActiveRecord::ConnectionAdapters::TransactionManager#within_new_transaction'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:386:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#within_new_transaction'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:378:in 'ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/transactions.rb:234:in 'block (2 levels) in ActiveRecord::Transactions::ClassMethods#transaction'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:485:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_pool_transaction_isolation_level'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/transactions.rb:233:in 'block in ActiveRecord::Transactions::ClassMethods#transaction'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:457:in 'ActiveRecord::ConnectionAdapters::ConnectionPool#with_connection'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/connection_handling.rb:313:in 'ActiveRecord::ConnectionHandling#with_connection'",
    "/usr/local/bundle/ruby/3.4.0/gems/activerecord-8.1.3.1/lib/active_record/transactions.rb:232:in 'ActiveRecord::Transactions::ClassMethods#transaction'",
    "/sagittarius/lib/sagittarius/database/transactional.rb:17:in 'Sagittarius::Database::Transactional#transactional'",
    "/sagittarius/app/services/namespaces/projects/flows/delete_service.rb:21:in 'Namespaces::Projects::Flows::DeleteService#execute'",
    "/sagittarius/app/graphql/mutations/namespaces/projects/flows/delete.rb:26:in 'Mutations::Namespaces::Projects::Flows::Delete#resolve'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/resolver.rb:189:in 'Kernel#public_send'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/resolver.rb:189:in 'GraphQL::Schema::Resolver#call_resolve'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/mutation.rb:69:in 'GraphQL::Schema::Mutation#call_resolve'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/resolver.rb:176:in 'block (3 levels) in GraphQL::Schema::Resolver#resolve_with_support'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:897:in 'GraphQL::Execution::Interpreter::Runtime#minimal_after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/query.rb:28:in 'GraphQL::Query::Runnable#after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/resolver.rb:164:in 'block (2 levels) in GraphQL::Schema::Resolver#resolve_with_support'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:897:in 'GraphQL::Execution::Interpreter::Runtime#minimal_after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/query.rb:28:in 'GraphQL::Query::Runnable#after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/resolver.rb:155:in 'block in GraphQL::Schema::Resolver#resolve_with_support'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:897:in 'GraphQL::Execution::Interpreter::Runtime#minimal_after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/query.rb:28:in 'GraphQL::Query::Runnable#after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/resolver.rb:143:in 'GraphQL::Schema::Resolver#resolve_with_support'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/has_single_input_argument.rb:9:in 'GraphQL::Schema::HasSingleInputArgument#resolve_with_support'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/relay_classic_mutation.rb:43:in 'GraphQL::Schema::RelayClassicMutation#resolve_with_support'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/field.rb:762:in 'Kernel#public_send'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/field.rb:762:in 'block (2 levels) in GraphQL::Schema::Field#resolve'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/field.rb:896:in 'GraphQL::Schema::Field#with_extensions'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/field.rb:733:in 'block in GraphQL::Schema::Field#resolve'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:897:in 'GraphQL::Execution::Interpreter::Runtime#minimal_after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/query.rb:28:in 'GraphQL::Query::Runnable#after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/field.rb:731:in 'GraphQL::Schema::Field#resolve'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:468:in 'block (2 levels) in GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_resolved_keyword_args'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/tracing/trace.rb:90:in 'GraphQL::Tracing::Trace#execute_field'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:467:in 'block in GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_resolved_keyword_args'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:815:in 'GraphQL::Execution::Interpreter::Runtime#call_method_on_directives'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:455:in 'GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_resolved_keyword_args'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:433:in 'block in GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_args'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:956:in 'GraphQL::Execution::Interpreter::Runtime#after_lazy'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:378:in 'GraphQL::Execution::Interpreter::Runtime#evaluate_selection_with_args'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/runtime.rb:372:in 'block in GraphQL::Execution::Interpreter::Runtime#evaluate_selection'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/execution/interpreter/arguments_cache.rb:49:in 'block in GraphQL::Execution::Interpreter::ArgumentsCache#dataload_for'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/schema/member/has_arguments.rb:295:in 'block (3 levels) in GraphQL::Schema::Member::HasArguments#coerce_arguments'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/dataloader.rb:360:in 'block in GraphQL::Dataloader#spawn_job_fiber'",
    "/usr/local/bundle/ruby/3.4.0/gems/graphql-2.6.9/lib/graphql/dataloader.rb:267:in 'block in GraphQL::Dataloader#spawn_fiber'"
  ],
  "exception_class": "ActiveRecord::StatementInvalid",
  "correlation_id": "cb266f98-337b-4b80-bb0d-f45d35663f3c",
  "meta.application": "puma",
  "meta.ip_address": "185.199.111.133",
  "meta.user": {
    "id": 2,
    "username": "root"
  },
  "meta.class": "GraphqlController"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    System

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions