Miscellaneous

Validation failed for type named Hour

Validation failed for type named Hour

by Daniel Jordan -
Number of replies: 2

If I set the Default Time that the Assignment is Due in General on Course Configuration to be 12:30pm (I also tried 12:00pm, the minutes are probably not important) I get the error below when I try to create an assignment. Anything not part of the noon hour is fine. It sounds like WeBWorK::Utils::DateTime::getDefaultSetDueDate is adding 12 to the hour despite it being 12:00pm, but I don't see why that would be happening. I was hoping 13:30 would be a workaround, but the Course Configuration rejects that. This is using version 2.19. Any ideas?

Error messages

Validation failed for type named Hour declared in package DateTime::Types (/usr/lib/x86_64-linux-gnu/perl5/5.38/DateTime/Types.pm) at line 101 in sub named (eval) with value 24 Trace begun at Specio::Exception->new line 57 Specio::Exception::throw('Specio::Exception', 'message', 'Validation failed for type named Hour declared in package DateTime::Types (/usr/lib/x86_64-linux-gnu/perl5/5.38/DateTime/Types.pm) at line 101 in sub named (eval) with value 24', 'type', 'Specio::Constraint::Simple=HASH(0x62f72d13d5b0)', 'value', 24) called at (eval 563) line 144 DateTime::_check_new_params('year', 2025, 'month', 9, 'day', 7, 'hour', 24, 'minute', 00, 'second', 0, 'time_zone', 'America/Chicago') called at /usr/lib/x86_64-linux-gnu/perl5/5.38/DateTime.pm line 177 DateTime::new('DateTime', 'year', 2025, 'month', 9, 'day', 7, 'hour', 24, 'minute', 00, 'second', 0, 'time_zone', 'America/Chicago') called at /opt/webwork/webwork2/lib/WeBWorK/Utils/DateTime.pm line 74 WeBWorK::Utils::DateTime::getDefaultSetDueDate('WeBWorK::CourseEnvironment=HASH(0x62f7376db6e0)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm line 462 WeBWorK::ContentGenerator::Instructor::ProblemSetList::create_handler('WeBWorK::ContentGenerator::Instructor::ProblemSetList=HASH(0x62f7376dbe30)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm line 241 WeBWorK::ContentGenerator::Instructor::ProblemSetList::initialize('WeBWorK::ContentGenerator::Instructor::ProblemSetList=HASH(0x62f7376dbe30)') called at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 146 eval {...} at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm line 109 WeBWorK::ContentGenerator::go('WeBWorK::ContentGenerator::Instructor::ProblemSetList=HASH(0x62f7376dbe30)') called at /usr/share/perl5/Mojolicious.pm line 193 Mojolicious::_action(undef, 'WeBWorK::ContentGenerator::Instructor::ProblemSetList=HASH(0x62f7376dbe30)', 'CODE(0x62f72dcf73a8)', 1) called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__ at /opt/webwork/webwork2/lib/Mojolicious/WeBWorK.pm line 165 eval {...} at /opt/webwork/webwork2/lib/Mojolicious/WeBWorK.pm line 145 Mojolicious::WeBWorK::__ANON__('CODE(0x62f7376aea98)', 'WeBWorK::ContentGenerator::Instructor::ProblemSetList=HASH(0x62f7376dbe30)', 'CODE(0x62f72dcf73a8)', 1) called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__ at /usr/share/perl5/Mojolicious/Plugins.pm line 18 Mojolicious::Plugins::emit_chain('Mojolicious::Plugins=HASH(0x62f729582e48)', 'around_action', 'WeBWorK::ContentGenerator::Instructor::ProblemSetList=HASH(0x62f7376dbe30)', 'CODE(0x62f72dcf73a8)', 1) called at /usr/share/perl5/Mojolicious/Routes.pm line 88 Mojolicious::Routes::_action('Mojolicious::WeBWorK=HASH(0x62f729582ce0)', 'WeBWorK::ContentGenerator::Instructor::ProblemSetList=HASH(0x62f7376dbe30)', 'CODE(0x62f72dcf73a8)', 1) called at /usr/share/perl5/Mojolicious/Routes.pm line 161 Mojolicious::Routes::_controller('Mojolicious::Routes=HASH(0x62f7279ffc28)', 'Mojolicious::Controller=HASH(0x62f737717dc0)', 'HASH(0x62f7373e89d8)', 1) called at /usr/share/perl5/Mojolicious/Routes.pm line 44 Mojolicious::Routes::continue('Mojolicious::Routes=HASH(0x62f7279ffc28)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious/Routes.pm line 46 Mojolicious::Routes::continue('Mojolicious::Routes=HASH(0x62f7279ffc28)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious/Routes.pm line 46 Mojolicious::Routes::continue('Mojolicious::Routes=HASH(0x62f7279ffc28)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious/Routes.pm line 46 Mojolicious::Routes::continue('Mojolicious::Routes=HASH(0x62f7279ffc28)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious/Routes.pm line 46 Mojolicious::Routes::continue('Mojolicious::Routes=HASH(0x62f7279ffc28)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious/Routes.pm line 52 Mojolicious::Routes::dispatch('Mojolicious::Routes=HASH(0x62f7279ffc28)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious.pm line 127 Mojolicious::dispatch('Mojolicious::WeBWorK=HASH(0x62f729582ce0)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious.pm line 136 Mojolicious::__ANON__(undef, 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__ at /usr/share/perl5/Mojolicious.pm line 203 eval {...} at /usr/share/perl5/Mojolicious.pm line 203 Mojolicious::_exception('CODE(0x62f737632050)', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious/Plugins.pm line 15 Mojolicious::Plugins::__ANON__ at /usr/share/perl5/Mojolicious/Plugins.pm line 18 Mojolicious::Plugins::emit_chain('Mojolicious::Plugins=HASH(0x62f729582e48)', 'around_dispatch', 'Mojolicious::Controller=HASH(0x62f737717dc0)') called at /usr/share/perl5/Mojolicious.pm line 141 Mojolicious::handler('Mojolicious::WeBWorK=HASH(0x62f729582ce0)', 'Mojo::Transaction::HTTP=HASH(0x62f73730ad90)') called at /usr/share/perl5/Mojo/Server.pm line 72 Mojo::Server::__ANON__('Mojo::Server::Prefork=HASH(0x62f72784c988)', 'Mojo::Transaction::HTTP=HASH(0x62f73730ad90)') called at /usr/share/perl5/Mojo/EventEmitter.pm line 15 Mojo::EventEmitter::emit('Mojo::Server::Prefork=HASH(0x62f72784c988)', 'request', 'Mojo::Transaction::HTTP=HASH(0x62f73730ad90)') called at /usr/share/perl5/Mojo/Server/Daemon.pm line 103 Mojo::Server::Daemon::__ANON__('Mojo::Transaction::HTTP=HASH(0x62f73730ad90)') called at /usr/share/perl5/Mojo/EventEmitter.pm line 15 Mojo::EventEmitter::emit('Mojo::Transaction::HTTP=HASH(0x62f73730ad90)', 'request') called at /usr/share/perl5/Mojo/Transaction/HTTP.pm line 60 Mojo::Transaction::HTTP::server_read('Mojo::Transaction::HTTP=HASH(0x62f73730ad90)', 'user=djordan&effectiveUser=djordan&visible_sets=Demo&visible_sets=editing_test&visible_sets=LinearEqns&visible_sets=Percent&visible_sets=Proportion&visible_sets=Student_Orientation&visible_sets=test&visible_sets=testinglots&prev_visible_sets=Demo&prev_visible_sets=editing_test&prev_visible_sets=LinearEqns&prev_visible_sets=Percent&prev_visible_sets=Proportion&prev_visible_sets=Student_Orientation&prev_visible_sets=test&prev_visible_sets=testinglots&editMode=0&exportMode=0&primarySortField=due_date&primarySortOrder=ASC&secondarySortField=open_date&secondarySortOrder=ASC&action=create&action.filter.scope=match_ids&action.filter.set_ids=&action.sort.primary=due_date&action.sort.primary.order=ASC&action.sort.secondary=open_date&action.sort.secondary.order=ASC&action.edit.scope=selected&action.publish.scope=selected&action.publish.value=1&action.import.number=1&action.import.name=&action.import.start.date=&action.import.assign=djordan&action.export.scope=selected&action.score.scope=selected&action.create.name=testing12&action.create.type=empty&action.delete.confirm=no') called at /usr/share/perl5/Mojo/Server/Daemon.pm line 224 Mojo::Server::Daemon::_read('Mojo::Server::Prefork=HASH(0x62f72784c988)', '7b12ee3d5e80822d1835f0b74f62c70f', 'user=djordan&effectiveUser=djordan&visible_sets=Demo&visible_sets=editing_test&visible_sets=LinearEqns&visible_sets=Percent&visible_sets=Proportion&visible_sets=Student_Orientation&visible_sets=test&visible_sets=testinglots&prev_visible_sets=Demo&prev_visible_sets=editing_test&prev_visible_sets=LinearEqns&prev_visible_sets=Percent&prev_visible_sets=Proportion&prev_visible_sets=Student_Orientation&prev_visible_sets=test&prev_visible_sets=testinglots&editMode=0&exportMode=0&primarySortField=due_date&primarySortOrder=ASC&secondarySortField=open_date&secondarySortOrder=ASC&action=create&action.filter.scope=match_ids&action.filter.set_ids=&action.sort.primary=due_date&action.sort.primary.order=ASC&action.sort.secondary=open_date&action.sort.secondary.order=ASC&action.edit.scope=selected&action.publish.scope=selected&action.publish.value=1&action.import.number=1&action.import.name=&action.import.start.date=&action.import.assign=djordan&action.export.scope=selected&action.score.scope=selected&action.create.name=testing12&action.create.type=empty&action.delete.confirm=no') called at /usr/share/perl5/Mojo/Server/Daemon.pm line 202 Mojo::Server::Daemon::__ANON__('Mojo::IOLoop::Stream=HASH(0x62f736b9b580)') called at /usr/share/perl5/Mojo/EventEmitter.pm line 15 Mojo::EventEmitter::emit('Mojo::IOLoop::Stream=HASH(0x62f736b9b580)', 'read', 'user=djordan&effectiveUser=djordan&visible_sets=Demo&visible_sets=editing_test&visible_sets=LinearEqns&visible_sets=Percent&visible_sets=Proportion&visible_sets=Student_Orientation&visible_sets=test&visible_sets=testinglots&prev_visible_sets=Demo&prev_visible_sets=editing_test&prev_visible_sets=LinearEqns&prev_visible_sets=Percent&prev_visible_sets=Proportion&prev_visible_sets=Student_Orientation&prev_visible_sets=test&prev_visible_sets=testinglots&editMode=0&exportMode=0&primarySortField=due_date&primarySortOrder=ASC&secondarySortField=open_date&secondarySortOrder=ASC&action=create&action.filter.scope=match_ids&action.filter.set_ids=&action.sort.primary=due_date&action.sort.primary.order=ASC&action.sort.secondary=open_date&action.sort.secondary.order=ASC&action.edit.scope=selected&action.publish.scope=selected&action.publish.value=1&action.import.number=1&action.import.name=&action.import.start.date=&action.import.assign=djordan&action.export.scope=selected&action.score.scope=selected&action.create.name=testing12&action.create.type=empty&action.delete.confirm=no') called at /usr/share/perl5/Mojo/IOLoop/Stream.pm line 109 Mojo::IOLoop::Stream::_read('Mojo::IOLoop::Stream=HASH(0x62f736b9b580)') called at /usr/share/perl5/Mojo/IOLoop/Stream.pm line 57 Mojo::IOLoop::Stream::__ANON__('Mojo::Reactor::EV=HASH(0x62f7290d2078)') called at /usr/share/perl5/Mojo/Reactor/Poll.pm line 141 eval {...} at /usr/share/perl5/Mojo/Reactor/Poll.pm line 141 Mojo::Reactor::Poll::_try('Mojo::Reactor::EV=HASH(0x62f7290d2078)', 'I/O watcher', 'CODE(0x62f730f81278)', 0) called at /usr/share/perl5/Mojo/Reactor/EV.pm line 54 Mojo::Reactor::EV::__ANON__('EV::IO=SCALAR(0x62f73728ed80)', 1) called at /usr/share/perl5/Mojo/Reactor/EV.pm line 32 eval {...} at /usr/share/perl5/Mojo/Reactor/EV.pm line 32 Mojo::Reactor::EV::start('Mojo::Reactor::EV=HASH(0x62f7290d2078)') called at /usr/share/perl5/Mojo/IOLoop.pm line 134 Mojo::IOLoop::start('Mojo::IOLoop=HASH(0x62f72909c640)') called at /usr/share/perl5/Mojo/Server/Prefork.pm line 152 Mojo::Server::Prefork::_spawn('Mojo::Server::Prefork=HASH(0x62f72784c988)') called at /usr/share/perl5/Mojo/Server/Prefork.pm line 93 Mojo::Server::Prefork::_manage('Mojo::Server::Prefork=HASH(0x62f72784c988)') called at /usr/share/perl5/Mojo/Server/Prefork.pm line 78 Mojo::Server::Prefork::run('Mojo::Server::Prefork=HASH(0x62f72784c988)') called at /usr/share/perl5/Mojo/Server/Hypnotoad.pm line 74 Mojo::Server::Hypnotoad::run('Mojo::Server::Hypnotoad=HASH(0x62f72784c6b8)', '/opt/webwork/webwork2/bin/webwork2') called at /usr/bin/hypnotoad line 14

Context

  • 9:   'h|help'       => \my $help,
  • 10:   's|stop'       => \$ENV{HYPNOTOAD_STOP},
  • 11:   't|test'       => \$ENV{HYPNOTOAD_TEST};
  • 12: 
  • 13: die extract_usage if $help || !(my $app = shift || $ENV{HYPNOTOAD_APP});
  • 14: Mojo::Server::Hypnotoad->new->run($app);
  • 15: 
  • 16: =encoding utf8
  • 17: 
  • 18: =head1 NAME
  • 19: 

Call stack

Request information

The HTTP request information is included in the following table.

HTTP request information
Item Data
Method POST
URI https://webwork.colum.edu/webwork2/DJsandbox/instructor/sets
HTTP Headers
HTTP request headers
Key Value
Accept-Language en-US,en;q=0.9
Accept text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Host webwork.colum.edu
sec-ch-ua-mobile ?0
Referer https://webwork.colum.edu/webwork2/DJsandbox/instructor/sets?effectiveUser=djordan
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Content-Length 1079
Sec-Fetch-User ?1
Upgrade-Insecure-Requests 1
Origin https://webwork.colum.edu
Sec-Fetch-Mode navigate
Connection keep-alive
Cookie WeBWorK.2FA.admin=ZGpvcmRhbg==--e908807136f5d8aa64427eb576723b28a71bcd6cf8ed21f7d08693ca863b1ec2; WeBWorKCourseSession.DJsandbox=eyJleHBpcmF0aW9uIjoxODAwLCJleHBpcmVzIjoxNzU2MDAzMTYwLCJrZXkiOiJ0Q3g3OXl3SDFnWHQweVRtOE1ZY1ByQ0RTY2syTnBrUiIsInRpbWVzdGFtcCI6MTc1NjAwMTM2MCwidXNlcl9pZCI6ImRqb3JkYW4ifQ----242736b2b6776ab058173963559a7eb99a5104c24a3d5f204bd6263ad142a14f; _gid=GA1.2.1099755001.1755794342; _gcl_au=1.1.2084144945.1755794343; __gsas=ID=2cd41086256fc193:T=1755794342:RT=1755794342:S=ALNI_MYwilBS0G17PgFbvfpst_FQEDdlTQ; _fbp=fb.1.1755794342689.39661059346777004; _scid=uuzLYIFxUebHxLhEZokxdc_xh-BbLid3; _tt_enable_cookie=1; _ttp=01K36QZ0TPGS59YRJ49H4SSAZS_.tt.1; _ScCbts=%5B%5D; _sctr=1%7C1755752400000; _ga_MFDFWZQYWJ=GS2.1.s1755887396$o3$g0$t1755887396$j60$l0$h0; _ga=GA1.1.1400030949.1755649166; _scid_r=tGzLYIFxUebHxLhEZokxdc_xh-BbLid3IXFOtQ; ttcsid=1755985513052::jlL-OtJDsQpbEHcOg6D6.2.1755985513052; _clck=14wcduc%5E2%5Efyp%5E0%5E2059; ttcsid_CGIU33BC77U1JI9QJ25G=1755985513051::0GdtYbd6xGMoAD4b5xLg.2.1755985513261; _clsk=a0es0t%5E1755985513385%5E1%5E1%5Ee.clarity.ms%2Fcollect; _ga_FESH74G94V=GS2.1.s1755985512$o2$g0$t1755985515$j57$l0$h0
Cache-Control max-age=0
Sec-Fetch-Dest document
Accept-Encoding gzip, deflate, br, zstd
Sec-Fetch-Site same-origin
Content-Type application/x-www-form-urlencoded
sec-ch-ua-platform "macOS"
sec-ch-ua Not;A=Brand;v=99, Google Chrome;v=139, Chromium;v=139

In reply to Daniel Jordan

Validation failed for type named Hour

by Danny Glin -
This was identified and fixed in September, 2024.  If you pull in the latest version of the code you will get the fix.
 
Since WW 2.20 has been released it's a little more complicated to just pull in hotfixes to a previous version without upgrading to the new version.  You would likely have to check out the WeBWorK-2.19+ tag from GitHub.