Version Check job is raising an exception on latest tests-passed

AI-generated summary

The Version Check job was failing on tests-passed instances due to an exception: undefined method > for nil:NilClass merefield. The root cause was the version check server not properly handling version strings with the -dev suffix, which prevented it from recognizing recent releases david. After fixes, the server now correctly returns 3.1.0.beta8 as the latest version, and 3.1.0 is also available for stable instances david. RGJ initially pointed out the server was still showing outdated versions, which helped identify the scope of the issue. merefield confirmed the fix and thanked David for the quick resolution.

Job exception: undefined method > for nil:NilClass

When I check for this attribute:

image

this attribute doesn’t exist.

Backtrace:

/var/www/discourse/app/jobs/scheduled/version_check.rb:21:in `execute' 
/var/www/discourse/app/jobs/base.rb:292:in `block (2 levels) in perform' 
rails_multisite-5.0.0/lib/rails_multisite/connection_management.rb:82:in `with_connection'
/var/www/discourse/app/jobs/base.rb:279:in `block in perform' 
/var/www/discourse/app/jobs/base.rb:275:in `each' 
/var/www/discourse/app/jobs/base.rb:275:in `perform' 
/var/www/discourse/app/jobs/base.rb:346:in `perform' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:202:in `execute_job' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:170:in `block (2 levels) in process' 
sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:177:in `block in invoke' 
/var/www/discourse/lib/sidekiq/pausable.rb:134:in `call' 
sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:179:in `block in invoke' 
sidekiq-6.5.9/lib/sidekiq/middleware/chain.rb:182:in `invoke' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:169:in `block in process' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch' 
sidekiq-6.5.9/lib/sidekiq/job_retry.rb:113:in `local' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch' 
sidekiq-6.5.9/lib/sidekiq.rb:44:in `block in <module:Sidekiq>' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:263:in `stats' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch' 
sidekiq-6.5.9/lib/sidekiq/job_logger.rb:13:in `call' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch' 
sidekiq-6.5.9/lib/sidekiq/job_retry.rb:80:in `global' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:124:in `block in dispatch' 
sidekiq-6.5.9/lib/sidekiq/job_logger.rb:39:in `prepare' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:123:in `dispatch' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:168:in `process' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:78:in `process_one' 
sidekiq-6.5.9/lib/sidekiq/processor.rb:68:in `run' 
sidekiq-6.5.9/lib/sidekiq/component.rb:8:in `watchdog' 
sidekiq-6.5.9/lib/sidekiq/component.rb:17:in `block in safe_thread' 

Thanks @merefield - the version check server needed some tweaks to understand the new -dev suffix on tests-passed version numbers. Should be working now:

[7] pry(main)> Discourse::VERSION::STRING
=> "3.2.0.beta1-dev"
[8] pry(main)> DiscourseHub.discourse_version_check
=> {"success"=>"OK", "latestVersion"=>"3.1.0.beta7", "criticalUpdates"=>false, "missingVersionsCount"=>0}

Great stuff! Thanks David!

But the latest version is not 3.1.0 beta7 right?
The server is still returning 3.0.6 for latest stable as well.

Wow yup, you’re absolutely right. The issue with understanding the -dev suffix meant that the server didn’t pick up last-week’s releases from GitHub :facepalm:. Thanks @RGJ!

On a tests-passed instance now:

[1] pry(main)> DiscourseHub.discourse_version_check
=> {"success"=>"OK",
 "latestVersion"=>"3.1.0.beta8",
 "criticalUpdates"=>false,
 "missingVersionsCount"=>1,
 "versions"=>
  [{"version"=>"3.1.0.beta8",
    "releasedAt"=>"2023-08-01T08:59:00.000Z",
    "critical"=>false,
    "notes"=>"Read about the release here:\r\n\r\nhttps://meta.discourse.org/t/273443",
    "url"=>"http://www.discourse.org/pricing"}]}

3.1.0 is also present in the version-check server now, so stable should be good as well.