hashview / hashview-old

A web front-end for password cracking and analytics
http://www.hashview.io
GNU General Public License v3.0
621 stars 134 forks source link

ArgumentError: cannot determine timezone from nil #294

Open nicbrink opened 7 years ago

nicbrink commented 7 years ago

On a brand new install of the 0.7 branch I receive this error when starting up.

07:28:31 web.1 | [2017-05-22 07:28:31] INFO WEBrick::HTTPServer#start: pid=23405 port=4567 07:28:32 background-worker.1 | rake aborted! 07:28:32 background-worker.1 | ArgumentError: cannot determine timezone from nil (etz:nil,tnz:"EDT",tzid:"constant") 07:28:32 background-worker.1 | Try setting ENV['TZ'] = 'Continent/City' in your script (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/rufus-scheduler-3.3.4/lib/rufus/scheduler/zotime.rb:41:in initialize' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/rufus-scheduler-3.3.4/lib/rufus/scheduler/zotime.rb:206:innew' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/rufus-scheduler-3.3.4/lib/rufus/scheduler/zotime.rb:206:in now' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/rufus-scheduler-3.3.4/lib/rufus/scheduler.rb:561:instart' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/rufus-scheduler-3.3.4/lib/rufus/scheduler.rb:109:in initialize' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:287:innew' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:287:in rufus_scheduler' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:143:inblock in load_schedule_job' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:138:in each' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:138:inload_schedule_job' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:100:in block in load_schedule!' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:99:ineach' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:99:in load_schedule!' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler.rb:52:inrun' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler/cli.rb:117:in run_forever' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/resque-scheduler-4.3.0/lib/resque/scheduler/tasks.rb:18:inblock (2 levels) in <top (required)>' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/gems/rake-11.2.2/exe/rake:27:in <top (required)>' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:ineval' 07:28:32 background-worker.1 | /home/pentest/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `

'

If I add the following line to background_worker.rb and also add "gem 'tzinfo-data'" to the Gemfile, then Hashview starts up.

backgrou_worker.rb: ENV['TZ'] = 'America/New_York'

ccammilleri commented 7 years ago

wtf?! haha gotta love these errors. but seriously, like always, thanks for testing!

Thats kinda weird. you should get 'tzinfo' during the bundle install and that should be enough. From my understanding the tzino-data gem is required for *nix based platforms.

Whats your platform (ubuntu XX), and are you using ruby via rvm?

I'm also wondering if you can just set that variable via command line when starting hashview and it would bypass the need of installing another (semi-redundant) gem.

nicbrink commented 7 years ago

I do hope adding to the issues helps. My ruby skills are pretty rudimentary, but I want to be of as much assistance as possible.

This testbox is ubuntu 14.04 and I am using ruby via rvm. 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Doing a bit more testing, I dont think I need to have the tzinfo-data gem in the Gemfile.

This worked: RACK_ENV=development TZ='America/New_York' foreman start as well as adding it to background_worker.rb: ENV['TZ'] = 'America/New_York'

Strangest thing is, I did a fresh install of 0.6 and I dont encounter this problem, which is weird.

i128 commented 7 years ago

OOC what happens if you run: timedatectl | grep "Time zone" on this system. I suspect the environment variable for time zone hasnt been set and as a result hashview cant read the value properly.

nicbrink commented 7 years ago

Here is what I get back. It does seem to have a timezone defined. timedatectl | grep "Time zone" Time zone: America/New_York (EDT, -0400)

Strange thing I only get this error or 0.7 and not 0.6.1.

I have been fixing it by: RACK_ENV=development TZ='America/New_York' foreman start

mdeous commented 6 years ago

Same error here using the latest revision (f71ed89ab21496d65ded835675e5ebbef1e755f2) on Ubuntu 16.10. @nicbrink's workaround (RACK_ENV=production TZ='Europe/Paris' foreman start) also works for me.

ccammilleri commented 6 years ago

bah! until we can look into this, i've updated the wiki with this workaround. Thanks guys!

https://github.com/hashview/hashview/wiki/02_Running-Hashview