Closed siddhantgoel closed 6 years ago
I have to same problem - but to be fair, I am not even able to migrate to AR with the very first commit of AR (5ab123d499d9cd43ef4ee182c78db19e46de3201).
The last working version for me is 0f3da81afa7782eab397a036bdcb2dc2edb0e752 - but that one is obviously still without AR-support.
The problem is with the location of database file. Before the move to AR it was located at db/production.sqlite3. Now it is expected to be at db/production/production.sqlite3. Just copy the old database into the production directory and the migrate should work properly.
Yes, this solves the issue...
Perhaps the migration script could take care of this automatically - or at least we should add a more prominent hint into the migration-documentation...
I know that the new location is mentioned at the bottom of the migration-guide - but still, it was not clear enough for me to realize, that I need to manually adjust the paths... :-)
That did solve the issue (thanks!). But now the syncing doesn't seem to work. I see the following exception in the logs -
2018-08-10 11:44:24 - ArgumentError - comparison of Integer with Time failed:
/home/bitwarden/bitwarden-ruby/lib/helpers/request_helpers.rb:23:in `>='
/home/bitwarden/bitwarden-ruby/lib/helpers/request_helpers.rb:23:in `device_from_bearer'
/home/bitwarden/bitwarden-ruby/lib/routes/api.rb:77:in `block (2 levels) in registered'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1635:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1635:in `block in compile!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:992:in `block (3 levels) in route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1011:in `route_eval'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:992:in `block (2 levels) in route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1040:in `block in process_route'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1038:in `catch'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1038:in `process_route'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:990:in `block in route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:989:in `each'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:989:in `route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1097:in `block in dispatch!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `block in invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `catch'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1094:in `dispatch!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:924:in `block in call!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `block in invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `catch'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:924:in `call!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:913:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/xss_header.rb:18:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/path_traversal.rb:16:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/json_csrf.rb:26:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/base.rb:50:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/base.rb:50:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb:31:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/logger.rb:15:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/common_logger.rb:33:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:231:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:224:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:194:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1958:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1502:in `block in call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1729:in `synchronize'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1502:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/handler/webrick.rb:86:in `service'
/home/bitwarden/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
/home/bitwarden/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
/home/bitwarden/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
192.168.178.20 - - [10/Aug/2018:11:44:24 +0000] "GET /api/sync HTTP/1.1" 500 30 0.2418
I got this error too, but only on my chrome extension. The mobile app synced properly. Somehow the error went away on its own after a few restarts. You can try doing that a few times.
Can you try the new migration script? You may want to delete the whole db/production/
database and re-run the tool to migrate your old db/production.sqlite3
database.
@jcs Thanks. The new migration script works. After this migration, the mobile app sync fine but the firefox extension doesn't. When I click on "Sync Vault Now", the extension shows an error message "Syncing failed", and the server logs contain the following exception -
2018-08-13 07:46:23 - ArgumentError - comparison of Integer with Time failed:
/home/bitwarden/bitwarden-ruby/lib/helpers/request_helpers.rb:23:in `>='
/home/bitwarden/bitwarden-ruby/lib/helpers/request_helpers.rb:23:in `device_from_bearer'
/home/bitwarden/bitwarden-ruby/lib/routes/api.rb:77:in `block (2 levels) in registered'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1635:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1635:in `block in compile!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:992:in `block (3 levels) in route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1011:in `route_eval'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:992:in `block (2 levels) in route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1040:in `block in process_route'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1038:in `catch'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1038:in `process_route'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:990:in `block in route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:989:in `each'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:989:in `route!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1097:in `block in dispatch!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `block in invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `catch'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1094:in `dispatch!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:924:in `block in call!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `block in invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `catch'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1076:in `invoke'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:924:in `call!'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:913:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/xss_header.rb:18:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/path_traversal.rb:16:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/json_csrf.rb:26:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/base.rb:50:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/base.rb:50:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb:31:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/logger.rb:15:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/common_logger.rb:33:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:231:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:224:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:194:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1958:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1502:in `block in call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1729:in `synchronize'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/sinatra-2.0.3/lib/sinatra/base.rb:1502:in `call'
/home/bitwarden/.rvm/gems/ruby-2.4.4/gems/rack-2.0.5/lib/rack/handler/webrick.rb:86:in `service'
/home/bitwarden/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
/home/bitwarden/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
/home/bitwarden/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
192.168.178.20 - - [13/Aug/2018:07:46:23 +0000] "GET /api/sync HTTP/1.1" 500 30 0.0152
I also tried restarting the server and the browser a few times as @tanshu suggested. But the problem still remains.
That looks like your device record has no token_expires_at
value for some reason. Can you try logging out in the extension and logging back in? That will trigger Device#regenerate_tokens!
which will set token_expires_at
.
Awesome, this worked. Thanks!
I tried to migrate from
bitwarden-ruby
this morning following the directions from https://github.com/jcs/rubywarden/blob/master/AR-MIGRATE.md .bundle --with migrate
worked without problems, after which I ran into the following exception.Not sure what I can do to fix this. Any help would be appreciated. Thank you!