שגיאת משימה: Holidays::InvalidRegion

אני חדש בפתרון בעיות של Discourse, אז אני לא בטוח מאיפה להתחיל עם זה.

זה התחיל לפני בערך חודש. אני עכשיו ב-4347 מופעים של Job exception: Holidays::InvalidRegion.

/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:83:in `block in validate!'
/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:82:in `each'
/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:82:in `validate!'
/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:41:in `parse_regions!'
/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:20:in `call'
/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/between.rb:14:in `call'
/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays.rb:49:in `between'
/var/www/discourse/plugins/discourse-calendar/app/services/discourse_calendar/holiday.rb:14:in `find_holidays_for'
/var/www/discourse/plugins/discourse-calendar/jobs/scheduled/create_holiday_events.rb:68:in `block in execute'
/var/www/discourse/plugins/discourse-calendar/jobs/scheduled/create_holiday_events.rb:66:in `each'
/var/www/discourse/plugins/discourse-calendar/jobs/scheduled/create_holiday_events.rb:66:in `execute'
/var/www/discourse/app/jobs/base.rb:318:in `block (2 levels) in perform'
rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in `with_connection'
/var/www/discourse/app/jobs/base.rb:305:in `block in perform'
/var/www/discourse/app/jobs/base.rb:301:in `each'
/var/www/discourse/app/jobs/base.rb:301:in `perform'
/var/www/discourse/app/jobs/base.rb:381:in `perform'
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:137:in `process_queue'
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:77:in `worker_loop'
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:63:in `block (2 levels) in ensure_worker_threads'

סביבה

hostname	discourse-app
process_id	3072273
application_version	66f53ac5b9c7fdcd53868ccabac310b13ffc8910
current_db	default
current_hostname	discourse.------------.net
job	DiscourseCalendar::CreateHolidayEvents
problem_db	default
time	2:53 pm

opts	

לא שינינו את התוסף discourse-calendar.

מישהו יכול להתחיל להפנות אותי לכיוון הנכון?

This is likely due to a recent update to the holiday definitions, which may have caused the generated region list to change without updating users’ existing Calendar Region preferences.

The error occurs for users who previously selected one of the now-removed regions as their Calendar Region.

You’re seeing that many instances of the exception because the scheduled job that triggers this runs every 10 minutes.

We’ll need to handle this more gracefully, by accounting for holiday definition updates that remove regions from the generated region list.

לייק 1

מעניין! אני יכול לומר שבסיס המשתמשים שלנו הוא בינלאומי באופן יוצא דופן, אז זה עשוי להיות קשור.

האם אני צודק להניח ש-1) אין לי מה לעשות בנידון ו-2) זה לא באמת משנה הרבה? או שאני צריך להגיש דיווח על באג?

תודה.

I’ve moved this topic to Bug, so there’s no need to make another report.

Since we haven’t actually removed any major regions here, I suspect the issue is related to state- or territory-level region definitions similar to what you see below for the US:

The change most likely happened between these two commits

That depends on your comfort level with poking around the internals. You’ll need to:

  1. Identify users who have a Calendar Region preference set.
  2. Check which of those values are not in the current list of valid regions:
    REGIONS.rb
  3. Update those users’ region preferences to a valid top-level region. For example, a preference setting like United States (us_id) should become United States

It does if your site uses holiday calendar events. For affected users, no holiday events will be generated until their Calendar Region is fixed.

2 לייקים

Thank you! I appreciate your help.

Was investigating the same issue because we had a surge in errors for our internal discourse instance, so I fixed it :wink:

3 לייקים

Wonderful! Thank you.