Scheduling a episode gives an error
-
I get this error when trying to a schedule a podcast episode (I deleted my city):
DateInvalidTimeZoneException DateTimeZone::__construct(): Unknown or bad timezone (America/CityDeleted) at /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php:92
When I copy the stack trace:
DateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (America/CityDeleted) in /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php:92 Stack trace: #0 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(92): DateTimeZone->__construct() #1 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(256): CodeIgniter\I18n\Time->__construct() #2 /app/code/modules/Admin/Controllers/EpisodeController.php(497): CodeIgniter\I18n\Time::createFromFormat() #3 /app/code/modules/Admin/Controllers/EpisodeController.php(64): Modules\Admin\Controllers\EpisodeController->attemptPublish() #4 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(932): Modules\Admin\Controllers\EpisodeController->_remap() #5 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(509): CodeIgniter\CodeIgniter->runController() #6 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(355): CodeIgniter\CodeIgniter->handleRequest() #7 /app/code/vendor/codeigniter4/framework/system/Boot.php(334): CodeIgniter\CodeIgniter->run() #8 /app/code/vendor/codeigniter4/framework/system/Boot.php(67): CodeIgniter\Boot::runCodeIgniter() #9 /app/code/public/index.php(61): CodeIgniter\Boot::bootWeb() #10 {main}
This happens both on the Cloudron demo server and my server.
Is this an upstream issue?
-
I did a comparison what timezone on Linux exist for America and compared them to the list of supported timezones in https://www.php.net/manual/en/timezones.america.php
Comparison can be found here: https://regex101.com/r/mXRK1J/1
Not supported timezones are:[...] America/Ensenada America/Fort_Wayne [...]
Setting my timezone to
America/Fort_Wayne
:timedatectl Local time: Mi 2025-05-28 02:04:21 EDT Universal time: Mi 2025-05-28 06:04:21 UTC RTC time: Mi 2025-05-28 06:04:20 Time zone: America/Fort_Wayne (EDT, -0400) System clock synchronized: no NTP service: inactive RTC in local TZ: no
In a Chrome based Browser running:
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone); America/Indianapolis
Good
America/Indianapolis
is not on the list https://www.php.net/manual/en/timezones.america.phpDateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (America/Indianapolis) in /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php:92 Stack trace: #0 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(92): DateTimeZone->__construct() #1 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(256): CodeIgniter\I18n\Time->__construct() #2 /app/code/modules/Admin/Controllers/PodcastController.php(697): CodeIgniter\I18n\Time::createFromFormat() #3 /app/code/modules/Admin/Controllers/PodcastController.php(53): Modules\Admin\Controllers\PodcastController->attemptPublish() #4 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(932): Modules\Admin\Controllers\PodcastController->_remap() #5 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(509): CodeIgniter\CodeIgniter->runController() #6 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(355): CodeIgniter\CodeIgniter->handleRequest() #7 /app/code/vendor/codeigniter4/framework/system/Boot.php(334): CodeIgniter\CodeIgniter->run() #8 /app/code/vendor/codeigniter4/framework/system/Boot.php(67): CodeIgniter\Boot::runCodeIgniter() #9 /app/code/public/index.php(61): CodeIgniter\Boot::bootWeb() #10 {main}
This is the exact error you are having.
Now in FireFox running:
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone); America/Indiana/Indianapolis
America/Indiana/Indianapolis
is on the list of supported timezone https://www.php.net/manual/en/timezones.america.phpAnd the scedule publish of castopod worked fine.
Solution / Error explanation
It seems your are using a Chrome based Browser on a Unix based system (macOS / Linux) and a Timezone that gets converted into a TimeZone that is not support by PHP.
Quick Fix
Use a different timezone that is more generic and check in the web console with:
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone);
if the timezone returned is avaiable in https://www.php.net/manual/en/timezones.america.php
What should be done in a perfect world
An issue should be raised with PHP and the Chomerium based browser you are using about this specific issue and Timezone.
Either PHP should support all timezone or the chrome based browser should convert it into a supported PHP version one like FireFox does.I hope this will solve your issue.
-
I get this error when trying to a schedule a podcast episode (I deleted my city):
DateInvalidTimeZoneException DateTimeZone::__construct(): Unknown or bad timezone (America/CityDeleted) at /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php:92
When I copy the stack trace:
DateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (America/CityDeleted) in /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php:92 Stack trace: #0 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(92): DateTimeZone->__construct() #1 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(256): CodeIgniter\I18n\Time->__construct() #2 /app/code/modules/Admin/Controllers/EpisodeController.php(497): CodeIgniter\I18n\Time::createFromFormat() #3 /app/code/modules/Admin/Controllers/EpisodeController.php(64): Modules\Admin\Controllers\EpisodeController->attemptPublish() #4 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(932): Modules\Admin\Controllers\EpisodeController->_remap() #5 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(509): CodeIgniter\CodeIgniter->runController() #6 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(355): CodeIgniter\CodeIgniter->handleRequest() #7 /app/code/vendor/codeigniter4/framework/system/Boot.php(334): CodeIgniter\CodeIgniter->run() #8 /app/code/vendor/codeigniter4/framework/system/Boot.php(67): CodeIgniter\Boot::runCodeIgniter() #9 /app/code/public/index.php(61): CodeIgniter\Boot::bootWeb() #10 {main}
This happens both on the Cloudron demo server and my server.
Is this an upstream issue?
Hello @superhua
This php error is saying that the timezone you have used is not supported and thus throwing this error.Error: https://www.php.net/manual/en/class.dateinvalidtimezoneexception.php
Thrown when an incorrect value is passed toDateTimeZone::__construct()
.
=> https://www.php.net/manual/en/datetimezone.construct.phpFrom the parameter
timezone
:One of the supported timezone names, an offset value (+0200), or a timezone abbreviation (BST).
https://www.php.net/manual/en/timezones.php
Please check if your city is even in the support timezone names and report back.
If this is truly the error, this might be something for upstream for better error handling in the UI to inform the User that the given timezone is not supported.
Not seen an issue about this in the official issue tracker for castopod https://code.castopod.org/adaures/castopod/-/issues/
-
After looking into the code of castopod I can see that the timezone is taken from the browser directly. There is no place to configure this, only on the local system level.
Some testing:
Windows 11, setting the Timezone to(UTC-04:00) Georgetown, La Paz, Manaus, San Juan
since this timezone also includes a_
character for extra measure.
In a Chrome based browser I validated the timezone in the console and tried to schedule publish a podcast.console.log(Intl.DateTimeFormat().resolvedOptions().timeZone); America/La_Paz
May 28 01:45:58 2a02:8109:abb5:7100:a141:da1d:5d:6aa - - [28/May/2025:05:45:58 +0000] "POST /cp-admin/podcasts/1/publish HTTP/1.1" 303 - "https://org.castopod.cloudronapp.cloudron.dev/cp-admin/podcasts/1/publish" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" May 28 01:45:58 2a02:8109:abb5:7100:a141:da1d:5d:6aa - - [28/May/2025:05:45:58 +0000] "GET /cp-admin/podcasts/1 HTTP/1.1" 200 6432 "https://org.castopod.cloudronapp.cloudron.dev/cp-admin/podcasts/1/publish" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" May 28 01:45:58 2a02:8109:abb5:7100:a141:da1d:5d:6aa - - [28/May/2025:05:45:58 +0000] "GET /media/podcasts/EEEEE/cover_thumbnail.webp HTTP/1.1" 304 - "https://org.castopod.cloudronapp.cloudron.dev/cp-admin/podcasts/1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" May 28 01:45:58 2a02:8109:abb5:7100:a141:da1d:5d:6aa - - [28/May/2025:05:45:58 +0000] "GET /themes/colors HTTP/1.1" 200 588 "https://org.castopod.cloudronapp.cloudron.dev/cp-admin/podcasts/1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" May 28 01:45:58 2a02:8109:abb5:7100:a141:da1d:5d:6aa - - [28/May/2025:05:45:58 +0000] "GET /media/podcasts/EEEEE/cover_federation.png HTTP/1.1" 304 - "https://org.castopod.cloudronapp.cloudron.dev/cp-admin/podcasts/1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" May 28 01:45:59 2a02:8109:abb5:7100:a141:da1d:5d:6aa - - [28/May/2025:05:45:59 +0000] "GET /manifest.webmanifest HTTP/1.1" 200 545 "https://org.castopod.cloudronapp.cloudron.dev/cp-admin/podcasts/1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" May 28 01:46:00 2a02:8109:abb5:7100:a141:da1d:5d:6aa - - [28/May/2025:05:46:00 +0000] "GET /sw.js HTTP/1.1" 200 1058 "https://org.castopod.cloudronapp.cloudron.dev/sw.js" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
draft mode This podcast is scheduled for publication on Friday, May 30, 2025 at 12:00 PM
This seems to be working.
Testing a Linux Client.
-
I did a comparison what timezone on Linux exist for America and compared them to the list of supported timezones in https://www.php.net/manual/en/timezones.america.php
Comparison can be found here: https://regex101.com/r/mXRK1J/1
Not supported timezones are:[...] America/Ensenada America/Fort_Wayne [...]
Setting my timezone to
America/Fort_Wayne
:timedatectl Local time: Mi 2025-05-28 02:04:21 EDT Universal time: Mi 2025-05-28 06:04:21 UTC RTC time: Mi 2025-05-28 06:04:20 Time zone: America/Fort_Wayne (EDT, -0400) System clock synchronized: no NTP service: inactive RTC in local TZ: no
In a Chrome based Browser running:
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone); America/Indianapolis
Good
America/Indianapolis
is not on the list https://www.php.net/manual/en/timezones.america.phpDateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (America/Indianapolis) in /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php:92 Stack trace: #0 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(92): DateTimeZone->__construct() #1 /app/code/vendor/codeigniter4/framework/system/I18n/TimeTrait.php(256): CodeIgniter\I18n\Time->__construct() #2 /app/code/modules/Admin/Controllers/PodcastController.php(697): CodeIgniter\I18n\Time::createFromFormat() #3 /app/code/modules/Admin/Controllers/PodcastController.php(53): Modules\Admin\Controllers\PodcastController->attemptPublish() #4 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(932): Modules\Admin\Controllers\PodcastController->_remap() #5 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(509): CodeIgniter\CodeIgniter->runController() #6 /app/code/vendor/codeigniter4/framework/system/CodeIgniter.php(355): CodeIgniter\CodeIgniter->handleRequest() #7 /app/code/vendor/codeigniter4/framework/system/Boot.php(334): CodeIgniter\CodeIgniter->run() #8 /app/code/vendor/codeigniter4/framework/system/Boot.php(67): CodeIgniter\Boot::runCodeIgniter() #9 /app/code/public/index.php(61): CodeIgniter\Boot::bootWeb() #10 {main}
This is the exact error you are having.
Now in FireFox running:
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone); America/Indiana/Indianapolis
America/Indiana/Indianapolis
is on the list of supported timezone https://www.php.net/manual/en/timezones.america.phpAnd the scedule publish of castopod worked fine.
Solution / Error explanation
It seems your are using a Chrome based Browser on a Unix based system (macOS / Linux) and a Timezone that gets converted into a TimeZone that is not support by PHP.
Quick Fix
Use a different timezone that is more generic and check in the web console with:
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone);
if the timezone returned is avaiable in https://www.php.net/manual/en/timezones.america.php
What should be done in a perfect world
An issue should be raised with PHP and the Chomerium based browser you are using about this specific issue and Timezone.
Either PHP should support all timezone or the chrome based browser should convert it into a supported PHP version one like FireFox does.I hope this will solve your issue.
-
-