Cells job fails: ActiveModel::RangeError: 100000000001 is out of range
Job #11152344456 failed for ba819fcb:
Root cause of failure
Done by GitLab Duo.
The job failed due to an ActiveModel::RangeError that occurred during database seeding. The specific error is:
ActiveModel::RangeError: 100000000001 is out of range for ActiveModel::Type::Integer with limit 4 bytes
Insert at cursor
This error occurred when the system attempted to save an Epic record during the seeding process. The chain of events was:
- The job was running
gdk cells upwhich involves setting up GitLab cells - During the database seeding phase (
db:seed_fu), the system was creating work items and epics - When trying to create an Epic through the
WorkItems::LegacyEpics::CreateService, the system attempted to save a record with an integer value of100000000001 - This value exceeds the maximum value that can be stored in a 4-byte integer field (which has a maximum value of 2,147,483,647 for signed integers)
- ActiveRecord's type validation caught this and raised the
RangeError, causing the entire seeding process to fail
The error trace shows this happened in the Epic creation process within the work items service, specifically when ActiveModel tried to serialize the value for database storage.
Example Fix
The fix would involve identifying which field is receiving the oversized integer value and addressing it in one of these ways:
-
Change the database column type: If the field legitimately needs to store values larger than 4-byte integers, migrate the column to use
bigint(8 bytes) instead ofinteger(4 bytes):
# In a migration file
def change
change_column :epics, :problematic_field_name, :bigint
end
Insert at cursor
-
Fix the seeding data: If this is happening during seeding, check the seed files (likely in
db/fixtures/or similar) and ensure the values being assigned are within the valid range for 4-byte integers. - Add validation in the model: Add validation to prevent such large values from being assigned:
# In the Epic model or related model
validates :field_name, numericality: {
greater_than: 0,
less_than: 2147483647
}
Insert at cursor
The most likely scenario is that a seed file or factory is generating an ID or sequence number that has grown too large for the integer column type. The immediate fix would be to either adjust the seeding logic to use smaller values or change the relevant database column to use bigint.