Job exception: undefined method > for nil:NilClass
prev_missing_versions_count = DiscourseUpdates.missing_versions_count || 0
json = DiscourseHub.discourse_version_check
DiscourseUpdates.last_installed_version = Discourse::VERSION::STRING
DiscourseUpdates.latest_version = json["latestVersion"]
DiscourseUpdates.critical_updates_available = json["criticalUpdates"]
DiscourseUpdates.missing_versions_count = json["missingVersionsCount"]
DiscourseUpdates.updated_at = Time.zone.now
DiscourseUpdates.missing_versions = json["versions"]
if SiteSetting.new_version_emails && json["missingVersionsCount"] > (0) &&
prev_missing_versions_count < (json["missingVersionsCount"].to_i)
message = VersionMailer.send_notice
Email::Sender.new(message, :new_version).send
end
rescue => e
raise e unless Rails.env.development? # Fail version check silently in development mode
end
end
true
end
When I check for this attribute:
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'
5 Likes
david
(David Taylor)
August 7, 2023, 7:41pm
3
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}
4 Likes
Great stuff! Thanks David!
3 Likes
RGJ
(Richard - Communiteq)
August 8, 2023, 9:39pm
5
But the latest version is not 3.1.0 beta7 right?
The server is still returning 3.0.6 for latest stable as well.
4 Likes
david
(David Taylor)
August 8, 2023, 11:14pm
6
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 . 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://payments.discourse.org/version/3.1.0.beta8"}]}
3.1.0 is also present in the version-check server now, so stable
should be good as well.
4 Likes
david
(David Taylor)
Closed
September 7, 2023, 11:15pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.