Job uitzondering: Holidays::InvalidRegion

Ik ben nieuw met het troubleshooten van Discourse, dus ik weet niet zeker waar ik moet beginnen.\n\nDit begon ongeveer een maand geleden. Ik heb nu 4347 instanties van Job exception: Holidays::InvalidRegion.\n\n\n/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:83:in `block in validate!'\n/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:82:in `each'\n/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:82:in `validate!'\n/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:41:in `parse_regions!'\n/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/parse_options.rb:20:in `call'\n/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays/finder/context/between.rb:14:in `call'\n/var/www/discourse/plugins/discourse-calendar/vendor/holidays/lib/holidays.rb:49:in `between'\n/var/www/discourse/plugins/discourse-calendar/app/services/discourse_calendar/holiday.rb:14:in `find_holidays_for'\n/var/www/discourse/plugins/discourse-calendar/jobs/scheduled/create_holiday_events.rb:68:in `block in execute'\n/var/www/discourse/plugins/discourse-calendar/jobs/scheduled/create_holiday_events.rb:66:in `each'\n/var/www/discourse/plugins/discourse-calendar/jobs/scheduled/create_holiday_events.rb:66:in `execute'\n/var/www/discourse/app/jobs/base.rb:318:in `block (2 levels) in perform'\nrails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'\nrails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in `with_connection'\n/var/www/discourse/app/jobs/base.rb:305:in `block in perform'\n/var/www/discourse/app/jobs/base.rb:301:in `each'\n/var/www/discourse/app/jobs/base.rb:301:in `perform'\n/var/www/discourse/app/jobs/base.rb:381:in `perform'\nmini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:137:in `process_queue'\nmini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:77:in `worker_loop'\nmini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:63:in `block (2 levels) in ensure_worker_threads'\n\n\nenv\n\nhostname\tdiscourse-app\nprocess_id\t3072273\napplication_version\t66f53ac5b9c7fdcd53868ccabac310b13ffc8910\ncurrent_db\tdefault\ncurrent_hostname\tdiscourse.------------.net\njob\tDiscourseCalendar::CreateHolidayEvents\nproblem_db\tdefault\ntime\t2:53 pm\n\t\nopts\t\n\n\nWe hebben de discourse-calendar plugin niet gewijzigd.\n\nKan iemand me op weg helpen?

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 like

Interessant! Ik kan zeggen dat onze gebruikersbasis uitzonderlijk internationaal is, dus dat zou kunnen kloppen.

Ga ik er correct van uit dat 1) ik hier niets aan kan doen en 2) het niet veel uitmaakt? Of moet ik een bugrapport indienen?

Bedankt

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 likes

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 likes

Wonderful! Thank you.