Closed cafeitduong closed 7 years ago
Looks like the timezone logged in sidekiq.log is not identical with local system timezone, so I wonder if it's the cause for this issue? How can I change the timezone to correct one please help me?
Hi @cafeitduong,
Sidekiq by design logs in UTC (https://github.com/mperham/sidekiq/wiki/Logging).
You can update the time zone for Scumblr in config/application.rb. There should be a line that indicates the current setting that you will need to update.
Additionally please make sure your system time is correct as this could cause the issue as well.
Please try the above and report back.
Thanks!
Hi @ahoernecke ,
In my config/application.rb already has
config.time_zone = 'Hanoi'
config.active_record.default_timezone = :local
And local machine has been set to Hanoi time too. I also restart the scumblr after save the config, but it's still the same result. The job get running for first about 30 search, and stop due to above error.
Thanks.
Can you run this command from your Scumblr folder and post the result:
rails r 'puts DateTime.now.to_i';date "+%s %Z"; curl -I https://api.github.com/events | grep '\(X-RateLimit-Reset:\)\|\(Last-Modified\)'
Hi @ahoernecke,
Here is the result:
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /home/scumblr/Scumblr/config/environments/production.rb:37)
DEPRECATION WARNING: You did not specify a `log_level` in `production.rb`. Currently, the default value for `log_level` is `:info` for the production environment and `:debug` in all other environments. In Rails 5 the default value will be unified to `:debug` across all environments. To preserve the current setting, add the following line to your `production.rb`:
config.log_level = :info
. (called from block in tsort_each at /home/scumblr/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228)
1481728110
1481728110 ICT
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 129k 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
X-RateLimit-Reset: 1481731695
Last-Modified: Wed, 14 Dec 2016 15:08:25 GMT
And system local time is: Wed Dec 14 22:10:23 ICT 2016
I'm not positive what's going on here, but it does look like your system time is slightly ahead of Github's and this could cause you to get an error when the sleep gets a negative number. I'll try to push up a fix later today.
Hi, I pushed an update that should hopefully address your issue. Can you update to the latest code on master, restart your server and sidekiq, and let me know if you notice a difference?
Hi @ahoernecke
Looks like the issue has gone, currently there are negative sleeping value but the task still running. I think issue has been resolved. Thanks a lot for prompt respond :)
Awesome, good to hear!
Hello,
The github code search task usually stop due to error : "Error: time interval must be positive", have anyone encountered the same? Please see below for the full error log: