Http_poller timezone is not being recognized

I am trying to run http_poller form logstash local machine

input {
  http_poller {
    urls => {
      test1 => "https://randomuser.me/api"
}
    request_timeout => 60
    schedule => { cron => "* * * * * UTC"}

    codec => "json"
    metadata_target => "http_poller_metadata"
  }
}

output {
  stdout {
    codec => rubydebug
  }
}

i have also tried the timezone => "UTC" there by removing the UTS from cron.
but gives me the error

Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:http_poller, :exception=>"Java::JavaLang::IllegalStateException", :message=>"Unable to configure plugins: (ArgumentError) Cannot determine timezone from nil\n(secs:1715105875.74,utc~:\"2024-05-07 18:17:55.7400000095367432\",ltz~:nil)\n(etz:nil,tnz:\"AST\",tziv:\"2.0.6\",tzidv:\"1.2023.3\",rv:\"3.1.4\",rp:\"java\",win:true,rorv:nil,astz:nil,eov:\"1.2.7\",eotnz:\"???\",eotnfz:\"???\",eotlzn:\"???\",\ndebian:nil,centos:nil,osx:nil)\nTry setting `ENV['TZ'] = 'Continent/City'` in your script (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)", :backtrace=>["org.logstash.config.ir.CompiledPipeline.<init>(CompiledPipeline.java:120)", "org.logstash.execution.AbstractPipelineExt.initialize(AbstractPipelineExt.java:186)", "org.logstash.execution.AbstractPipelineExt$INVOKER$i$initialize.call(AbstractPipelineExt$INVOKER$i$initialize.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:847)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1319)", "org.jruby.ir.instructions.InstanceSuperInstr.interpret(InstanceSuperInstr.java:139)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:367)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:446)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)", "org.jruby.RubyClass.newInstance(RubyClass.java:931)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:446)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)", "org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:367)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)", "org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:88)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:228)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:476)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:293)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:328)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)", "org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116)", "org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:66)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)", "org.jruby.runtime.Block.call(Block.java:144)", "org.jruby.RubyProc.call(RubyProc.java:352)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:111)", "java.base/java.lang.Thread.run(Thread.java:840)"]}
[2024-05-07T21:17:57,829][INFO ][logstash.runner          ] Logstash shut down.
[2024-05-07T21:17:57,834][FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:808) ~[jruby.jar:?]
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:767) ~[jruby.jar:?]
        at D_3a_.Elk_20_Stack.logstash_minus_8_dot_11_dot_3.lib.bootstrap.environment.<main>(D:\Elk Stack\logstash-8.11.3\lib\bootstrap\environment.rb:90) ~[?:?]

#http_poller Logstash logstash

Searching for "Cannot determine timezone from nil" in these forums finds several instances of this error. All of them contain additional detail like 'etz:nil,tnz:"AST"', or 'etz:nil,tnz:"MEZ"', 'etz:nil,tnz:"ICT"', or 'etz:nil,tnz:"TST"', or 'etz:nil,tnz:"COT"', or 'etz:nil,tnz:"PET"', or 'etz:nil,tnz:"ALMT"'. Those all look like timezone abbreviations to me

AST     Atlantic (-4)
MEZ     an alias for CET
ICT     Indochina (+7)
TST     Taiwan (+8)
COT     Colombia (-5)
PET     Peru (-5)
ALMT    Alma-Ata (+6)

but none of them are in Joda's list of accepted TZ abbreviations, so I think the library logstash uses to parse them is unable to do so, resulting in it having no timezone info.

As the error message says

Try setting ENV['TZ'] = 'Continent/City' in your script

that is, in the script that invokes logstash. If you are running logstash as a service you will need to add that to the service startup script.

You appear to be using AST. Someplaces that use AST also use ADT (daylight savings) and some do not. You will definitely need to use a Continent/City type timezone name for this to work.

No help to you, but In the case of a jdbc input, you may be able to set the jdbc_default_timezone to avoid this error, and in extreme cases I have known folks change the timezone setting of the entire machine to "fix" it.

I think someone had a similar issue. The solution, actually workaround was to set the time zone as TZ environment variable and reboot OS.

We change the timezone of the servers iteself and the machiens time to UTC so its now fixed but facing different issue in the plugin it gets timeout error i will open new topic for that