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

active_record_migrations.rb raises Unknown migration version "7.2"; expected one of "4.2", "5.0", "5.1", "5.2", "6.0", "6.1", "7.0", "7.1" (ArgumentError) #50380

Closed
yahonda opened this issue Dec 17, 2023 · 0 comments · Fixed by #50381

Comments

@yahonda
Copy link
Member

yahonda commented Dec 17, 2023

There is a CI failure at https://buildkite.com/rails/rails/builds/102815#018c7671-f43c-4e7a-a654-03893ab28d0f/1384-1395

Steps to reproduce

git clone https://github.com/rails/rails
cd rails/guides/bug_report_templates
ruby active_record_migrations.rb

Expected behavior

It should pass.

Actual behavior

It raises Unknown migration version "7.2"; expected one of "4.2", "5.0", "5.1", "5.2", "6.0", "6.1", "7.0", "7.1" (ArgumentError).

$ ruby active_record_migrations.rb
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies....
Using rake 13.1.0
Using base64 0.2.0
Using timeout 0.4.1
Using mini_mime 1.1.5
Using date 3.3.4
Using bundler 2.3.22
Using io-console 0.7.1
Using stringio 3.1.0
Using webrick 1.8.1
Using thor 1.3.0
Using sqlite3 1.6.9 (x86_64-linux)
Using net-protocol 0.2.2
Using psych 5.1.1.1
Using reline 0.4.1
Using connection_pool 2.4.1
Using ruby2_keywords 0.0.5
Using minitest 5.20.0
Using mutex_m 0.2.0
Using builder 3.2.4
Using erubi 1.12.0
Using racc 1.7.3
Using crass 1.0.6
Using rack 3.0.8
Using drb 2.2.0
Using nokogiri 1.15.5 (x86_64-linux)
Using net-imap 0.4.8
Using net-pop 0.1.2
Using net-smtp 0.4.0
Using rdoc 6.6.2
Using websocket-extensions 0.1.5
Using bigdecimal 3.1.5
Using marcel 1.0.2
Using concurrent-ruby 1.2.2
Using nio4r 2.7.0
Using loofah 2.22.0
Using rack-session 2.0.0
Using rack-test 2.1.0
Using websocket-driver 0.7.6
Using mail 2.8.1
Using irb 1.10.1
Using rackup 2.1.0
Using zeitwerk 2.6.12
Using i18n 1.14.1
Using rails-html-sanitizer 1.6.0
Using tzinfo 2.0.6
Using activesupport 7.1.2
Using rails-dom-testing 2.2.0
Using globalid 1.2.1
Using activemodel 7.1.2
Using actionview 7.1.2
Using activejob 7.1.2
Using activerecord 7.1.2
Using actionpack 7.1.2
Using activestorage 7.1.2
Using actionmailer 7.1.2
Using actionmailbox 7.1.2
Using actioncable 7.1.2
Using actiontext 7.1.2
Using railties 7.1.2
Using rails 7.1.2
-- create_table(:payments, {:force=>true})
D, [2023-12-17T17:32:35.577211 #823527] DEBUG -- :    (0.0ms)  DROP TABLE IF EXISTS "payments"
D, [2023-12-17T17:32:35.577532 #823527] DEBUG -- :    (0.1ms)  CREATE TABLE "payments" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal(10,0) DEFAULT 0 NOT NULL)
   -> 0.0078s
D, [2023-12-17T17:32:35.578502 #823527] DEBUG -- :    (0.1ms)  CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
D, [2023-12-17T17:32:35.579533 #823527] DEBUG -- :    (0.1ms)  CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
D, [2023-12-17T17:32:35.592536 #823527] DEBUG -- :   ActiveRecord::InternalMetadata Load (1.1ms)  SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1  [[nil, "environment"]]
D, [2023-12-17T17:32:35.592848 #823527] DEBUG -- :   ActiveRecord::InternalMetadata Create (0.1ms)  INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('environment', 'development', '2023-12-17 08:32:35.592603', '2023-12-17 08:32:35.592607') RETURNING "key"
/home/yahonda/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.2/lib/active_record/migration/compatibility.rb:11:in `find': Unknown migration version "7.2"; expected one of "4.2", "5.0", "5.1", "5.2", "6.0", "6.1", "7.0", "7.1" (ArgumentError)

          raise ArgumentError, "Unknown migration version #{version.inspect}; expected one of #{versions.sort.join(', ')}"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /home/yahonda/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.2/lib/active_record/migration.rb:613:in `[]'
	from active_record_migrations.rb:34:in `<main>'
yahonda@myryzen:~/src/github.com/rails/rails/guides/bug_report_templates$
yahonda@myryzen:~/src/github.com/rails/rails/guides/bug_report_templates$
yahonda@myryzen:~/src/github.com/rails/rails/guides/bug_report_templates$
yahonda@myryzen:~/src/github.com/rails/rails/guides/bug_report_templates$
yahonda@myryzen:~/src/github.com/rails/rails/guides/bug_report_templates$ ruby active_record_migrations.rb
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies....
Using rake 13.1.0
Using base64 0.2.0
Using bigdecimal 3.1.5
Using concurrent-ruby 1.2.2
Using connection_pool 2.4.1
Using ruby2_keywords 0.0.5
Using minitest 5.20.0
Using mutex_m 0.2.0
Using builder 3.2.4
Using erubi 1.12.0
Using racc 1.7.3
Using crass 1.0.6
Using rack 3.0.8
Using nio4r 2.7.0
Using websocket-extensions 0.1.5
Using zeitwerk 2.6.12
Using timeout 0.4.1
Using marcel 1.0.2
Using mini_mime 1.1.5
Using date 3.3.4
Using bundler 2.3.22
Using io-console 0.7.1
Using stringio 3.1.0
Using webrick 1.8.1
Using thor 1.3.0
Using sqlite3 1.6.9 (x86_64-linux)
Using drb 2.2.0
Using i18n 1.14.1
Using tzinfo 2.0.6
Using nokogiri 1.15.5 (x86_64-linux)
Using rack-session 2.0.0
Using rack-test 2.1.0
Using websocket-driver 0.7.6
Using net-protocol 0.2.2
Using psych 5.1.1.1
Using reline 0.4.1
Using rackup 2.1.0
Using activesupport 7.1.2
Using loofah 2.22.0
Using net-imap 0.4.8
Using net-pop 0.1.2
Using net-smtp 0.4.0
Using rdoc 6.6.2
Using rails-dom-testing 2.2.0
Using irb 1.10.1
Using globalid 1.2.1
Using activemodel 7.1.2
Using activejob 7.1.2
Using rails-html-sanitizer 1.6.0
Using mail 2.8.1
Using activerecord 7.1.2
Using actionview 7.1.2
Using actionpack 7.1.2
Using actioncable 7.1.2
Using activestorage 7.1.2
Using actionmailer 7.1.2
Using railties 7.1.2
Using actionmailbox 7.1.2
Using actiontext 7.1.2
Using rails 7.1.2
-- create_table(:payments, {:force=>true})
D, [2023-12-17T17:33:01.178868 #823958] DEBUG -- :    (0.0ms)  DROP TABLE IF EXISTS "payments"
D, [2023-12-17T17:33:01.179208 #823958] DEBUG -- :    (0.1ms)  CREATE TABLE "payments" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal(10,0) DEFAULT 0 NOT NULL)
   -> 0.0077s
D, [2023-12-17T17:33:01.180190 #823958] DEBUG -- :    (0.1ms)  CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
D, [2023-12-17T17:33:01.181233 #823958] DEBUG -- :    (0.1ms)  CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
D, [2023-12-17T17:33:01.194049 #823958] DEBUG -- :   ActiveRecord::InternalMetadata Load (0.9ms)  SELECT * FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? ORDER BY "ar_internal_metadata"."key" ASC LIMIT 1  [[nil, "environment"]]
D, [2023-12-17T17:33:01.194366 #823958] DEBUG -- :   ActiveRecord::InternalMetadata Create (0.1ms)  INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('environment', 'development', '2023-12-17 08:33:01.194117', '2023-12-17 08:33:01.194121') RETURNING "key"
/home/yahonda/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.2/lib/active_record/migration/compatibility.rb:11:in `find': Unknown migration version "7.2"; expected one of "4.2", "5.0", "5.1", "5.2", "6.0", "6.1", "7.0", "7.1" (ArgumentError)

          raise ArgumentError, "Unknown migration version #{version.inspect}; expected one of #{versions.sort.join(', ')}"
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /home/yahonda/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.2/lib/active_record/migration.rb:613:in `[]'
	from active_record_migrations.rb:34:in `<main>'
$

System configuration

Rails version: main branch

Ruby version: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant