anlek / mongify

Mongify allows you to map your data from a sql database and into a mongodb document database.
http://github.com/anlek/mongify
MIT License
315 stars 81 forks source link

DEPRECATION WARNING/Database command 'update' failed: #130

Closed optimus93 closed 7 years ago

optimus93 commented 7 years ago

Iam geting some kind of deprication error notification as well as some kind of error at the end of a translation process even though the translation is successful. Could someone tell me how can i clear that error. I have pasted the below details of the gems i have installed, and the errors along with the successful translation etc.

**C:\RubyDevKit\bin>gem list

LOCAL GEMS activemodel (5.0.1, 4.2.7.1, 4.2.6) activerecord (5.0.1, 4.2.7.1, 4.2.6) activesupport (5.0.1, 4.2.7.1, 4.2.6) arel (7.1.4, 6.0.4) bigdecimal (1.2.8) binding_of_caller (0.7.2) bond (0.5.1) bson (4.2.1, 1.12.5) bson_ext (1.12.5) builder (3.2.3) bundler (1.14.3) coderay (1.1.1) columnize (0.9.0) concurrent-ruby (1.0.4) cucumber (2.4.0) cucumber-core (1.5.0) cucumber-wire (0.0.1) debug_inspector (0.0.2) debugger-linecache (1.2.0) debugger-ruby_core_source (1.3.8) did_you_mean (1.0.0) diff-lcs (1.3) gherkin (4.0.0) highline (1.7.8) i18n (0.8.0) interception (0.5) io-console (0.4.5) jist (1.5.1) json (2.0.3, 1.8.3) metaclass (0.0.4) method_source (0.8.2) minitest (5.8.5) mocha (1.2.1) mongify (1.3.1) mongo (1.12.5) multi_json (1.12.1) multi_test (0.1.2) mysql2 (0.4.5 x64-mingw32) net-telnet (0.1.1) pg (0.19.0 x64-mingw32) power_assert (0.2.6) pry (0.10.4) pry-rescue (1.4.4) pry-stack_explorer (0.4.9.2) psych (2.1.0) rake (12.0.0, 10.4.2) rdoc (4.2.1) rspec (3.5.0) rspec-core (3.5.4) rspec-expectations (3.5.0) rspec-mocks (3.5.0) rspec-support (3.5.0) slop (3.6.0) sqlite3 (1.3.13 x64-mingw32) test-unit (3.1.5) thread_safe (0.3.5) tzinfo (1.2.2) watchr (0.7) yard (0.9.8)

C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/db.rb:610:in `rescue in command': Database command 'update' failed: Unknown option to update command: multi (Mongo::OperationFailure) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/db.rb:606:in command' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:314:inblock in send_write_command' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:55:in block in instrument' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:20:ininstrument' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:54:in instrument' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:313:insend_write_command' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:1104:in send_write' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:497:inupdate' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/database/no_sql_connection.rb:145:in remove_pre_mongified_ids' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/processor_common.rb:116:inblock in remove_pre_mongified_ids' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/processor_common.rb:114:in each' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/processor_common.rb:114:inremove_pre_mongified_ids' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/process.rb:18:in process' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/cli/command/worker.rb:72:inexecute' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/cli/application.rb:28:in execute!' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mongify-1.3.1/bin/mongify:15:in<top (required)>' from C:/Ruby23-x64/bin/mongify:22:in load' from C:/Ruby23-x64/bin/mongify:22:in

'

anlek commented 7 years ago

Thanks for sharing. Can I ask you to uninstall bson version 4.2.1. and rerun the command.

optimus93 commented 7 years ago

Does it solve the deprication error or the error that occurs at the completion of translation process...i removed the bson 4.2.1 and the deprecation warning persists .

anlek commented 7 years ago

I was hoping it would fix the Database command 'update' failed: Unknown option to update command.

optimus93 commented 7 years ago

Oki cool.. let me check brother... iv put it on process translation... could u tell me wats the deprication error too.. hw do i deal witth that..

optimus93 commented 7 years ago

Oki iv tried it , but the update error still persists :/ .

anlek commented 7 years ago

Hey @optimus93, seems like same error reported in issue #124, looks like the drivers mongify is using are not compatible with version 3.4 of MongoDB. I'm currently unable to put effort into fixing it, but will gladly review pull requests.

optimus93 commented 7 years ago

This worked: 1) Removing the rails (activesupport/ activemodel/ activereport) - 5.0.1 versions solved the deprication error. 2) Downgraded to MongoDB 3.2 from 3.4 and " failed to update command " is no more there. Now mongify runs smooth .

@anlek It wud be nyc if you could fix the issue in 3.4 brother. Peace !!!

anlek commented 7 years ago

Hey @optimus93, I'd love to, but currently I have a lot of contract work to do. However, I'm open to review PR that would fix the issue.

cyrishikesh commented 5 years ago

@anlek error ![error](https://user-images.githubusercontent.com/28404660/59676329-f32e9c80-91e4-11e9-9f4d-4b2d726f7df1.png)

I am trying to migrate data from mysql to mongodb but I am getting below error on "process" command. Similar type of error is discussed above but solutions to downgrade version of mongodb no longer available option in ubuntu 18.04. What can be done to solve this error. My gems file is mentioned below.

LOCAL GEMS

activemodel (4.2.11.1) activerecord (4.2.11.1) activesupport (4.2.11.1) arel (6.0.4) bigdecimal (default: 1.3.4) bson (4.2.1, 1.12.5) bson_ext (1.12.5) builder (3.2.3) bundler (2.0.2) cmath (default: 1.0.0) concurrent-ruby (1.1.5) csv (default: 1.0.0) date (default: 1.0.0) dbm (default: 1.0.0) did_you_mean (1.2.0) etc (default: 1.0.0) fcntl (default: 1.0.0) fiddle (default: 1.0.0) fileutils (default: 1.0.2) gdbm (default: 2.0.0) highline (1.7.8) i18n (0.9.5) io-console (default: 0.4.6) ipaddr (default: 1.2.0) json (2.2.0, default: 2.1.0) minitest (5.10.3) mongify (1.3.2) mongo (1.12.5) mysql2 (0.4.2) net-telnet (0.1.1) openssl (default: 2.1.1) power_assert (0.2.7) psych (default: 3.0.2) rake (12.3.1) rdoc (default: 6.0.1) scanf (default: 1.0.0) sdbm (default: 1.0.0) stringio (default: 0.0.1) strscan (default: 1.0.0) test-unit (3.2.5) thread_safe (0.3.6) tzinfo (1.2.5) webrick (default: 1.4.2) zlib (default: 1.0.0)

Error:

Copying patient_request_master (1/1): (5271/5271) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_diagnosis_detail (1/: (10000/10000) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_diagnosis_detail (2/: (2616/2616) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_grouping_detail (1/1: (5269/5269) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_procedure_detail (1/: (6733/6733) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Updating References patientrequest: (5271/5271) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:01 Updating References patient_diagnosi: (12616/12616) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:03 Updating References patient_grouping: (5269/5269) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:01 Updating References patient_procedur: (6733/6733) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:01 Traceback (most recent call last):re: (0/1) 0% | | ETA: --:--:-- 18: from /usr/local/bin/mongify:23:in <main>' 17: from /usr/local/bin/mongify:23:inload' 16: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/bin/mongify:17:in <top (required)>' 15: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/cli/application.rb:28:inexecute!' 14: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/cli/command/worker.rb:72:in execute' 13: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/process.rb:18:inprocess' 12: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:114:in remove_pre_mongified_ids' 11: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:114:ineach' 10: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:116:in block in remove_pre_mongified_ids' 9: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/database/no_sql_connection.rb:145:inremove_pre_mongified_ids' 8: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection.rb:497:in update' 7: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection.rb:1104:insend_write' 6: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:313:in send_write_command' 5: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:54:ininstrument' 4: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:20:in instrument' 3: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:55:inblock in instrument' 2: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:314:in block in send_write_command' 1: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/db.rb:606:incommand' /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/db.rb:610:in `rescue in command': Database command 'update' failed: BSON field 'update.multi' is an unknown field. (Mongo::OperationFailure)

Thanks

anlek commented 5 years ago

What version of mongo db are you running?

On Tue, Jun 18, 2019, 3:53 AM Rishikesh Chaudhary notifications@github.com wrote:

@anlek https://github.com/anlek [image: error] https://user-images.githubusercontent.com/28404660/59676303-e316bd00-91e4-11e9-8dfe-9bb9f388fe72.png error

I am trying to migrate data from mysql to mongodb but I am getting below error on "process" command. Similar type of error is discussed above but solutions to downgrade version of mongodb no longer available option in ubuntu 18.04. What can be done to solve this error. My gems file is mentioned below.

LOCAL GEMS

activemodel (4.2.11.1) activerecord (4.2.11.1) activesupport (4.2.11.1) arel (6.0.4) bigdecimal (default: 1.3.4) bson (4.2.1, 1.12.5) bson_ext (1.12.5) builder (3.2.3) bundler (2.0.2) cmath (default: 1.0.0) concurrent-ruby (1.1.5) csv (default: 1.0.0) date (default: 1.0.0) dbm (default: 1.0.0) did_you_mean (1.2.0) etc (default: 1.0.0) fcntl (default: 1.0.0) fiddle (default: 1.0.0) fileutils (default: 1.0.2) gdbm (default: 2.0.0) highline (1.7.8) i18n (0.9.5) io-console (default: 0.4.6) ipaddr (default: 1.2.0) json (2.2.0, default: 2.1.0) minitest (5.10.3) mongify (1.3.2) mongo (1.12.5) mysql2 (0.4.2) net-telnet (0.1.1) openssl (default: 2.1.1) power_assert (0.2.7) psych (default: 3.0.2) rake (12.3.1) rdoc (default: 6.0.1) scanf (default: 1.0.0) sdbm (default: 1.0.0) stringio (default: 0.0.1) strscan (default: 1.0.0) test-unit (3.2.5) thread_safe (0.3.6) tzinfo (1.2.5) webrick (default: 1.4.2) zlib (default: 1.0.0)

Error:

Copying patient_request_master (1/1): (5271/5271) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_diagnosis_detail (1/: (10000/10000) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_diagnosis_detail (2/: (2616/2616) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_grouping_detail (1/1: (5269/5269) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying patient_procedure_detail (1/: (6733/6733) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Updating References patientrequest: (5271/5271) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:01 Updating References patient_diagnosi: (12616/12616) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:03 Updating References patient_grouping: (5269/5269) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:01 Updating References patient_procedur: (6733/6733) 100% |ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:01 Traceback (most recent call last):re: (0/1) 0% | | ETA: --:--:-- 18: from /usr/local/bin/mongify:23:in

' 17: from /usr/local/bin/mongify:23:in load' 16: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/bin/mongify:17:in <top (required)>' 15: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/cli/application.rb:28:in execute!' 14: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/cli/command/worker.rb:72:in execute' 13: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/process.rb:18:in process' 12: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:114:in remove_pre_mongified_ids' 11: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:114:in each' 10: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:116:in block in remove_pre_mongified_ids' 9: from /var/lib/gems/2.5.0/gems/mongify-1.3.2/lib/mongify/database/no_sql_connection.rb:145:in remove_pre_mongified_ids' 8: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection.rb:497:in update' 7: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection.rb:1104:in send_write' 6: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:313:in send_write_command' 5: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:54:in instrument' 4: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:20:in instrument' 3: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:55:in block in instrument' 2: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:314:in block in send_write_command' 1: from /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/db.rb:606:in command' /var/lib/gems/2.5.0/gems/mongo-1.12.5/lib/mongo/db.rb:610:in `rescue in command': Database command 'update' failed: BSON field 'update.multi' is an unknown field. (Mongo::OperationFailure)

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/anlek/mongify/issues/130?email_source=notifications&email_token=AAACWLBSDE2E5BNDLOHL6K3P3C5BFA5CNFSM4C7S3XB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX57XZI#issuecomment-503053285, or mute the thread https://github.com/notifications/unsubscribe-auth/AAACWLADRDISHJRNKSD3P4DP3C5BFANCNFSM4C7S3XBQ .

TheBeachMaster commented 5 years ago

@anlek I'm facing the same error running the latest tagged image from Docker hub.

$ sudo docker exec -ti 833d1e90b962 /bin/bash
root@833d1e90b962:/# mongo -version
MongoDB shell version v4.0.10
git version: c389e7f69f637f7a1ac3cc9fae843b635f20b766
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1604
    distarch: x86_64
    target_arch: x86_64

Here's a snippet of the log

/Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/db.rb:610:in `rescue in command': Database command 'update' failed: BSON field 'update.multi' is an unknown field. (Mongo::OperationFailure)                                                                    | ETA:  --:--:--
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/db.rb:606:in `command'
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:314:in `block in send_write_command'
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:55:in `block in instrument'
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:20:in `instrument'
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:54:in `instrument'
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:313:in `send_write_command'
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:1104:in `send_write'
    from /Library/Ruby/Gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:497:in `update'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/lib/mongify/database/no_sql_connection.rb:145:in `remove_pre_mongified_ids'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:116:in `block in remove_pre_mongified_ids'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:114:in `each'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/lib/mongify/translation/processor_common.rb:114:in `remove_pre_mongified_ids'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/lib/mongify/translation/process.rb:18:in `process'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/lib/mongify/cli/command/worker.rb:72:in `execute'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/lib/mongify/cli/application.rb:28:in `execute!'
    from /Library/Ruby/Gems/2.3.0/gems/mongify-1.3.2/bin/mongify:17:in `<top (required)>'
    from /usr/local/bin/mongify:22:in `load'
    from /usr/local/bin/mongify:22:in `<main>'
TheBeachMaster commented 5 years ago

UPDATE : Anyone facing this issue, kindly refer to this comment by @anlek .

What version of MongoDB are you running? Currently, only 3.2 or lower is supported.

I downgraded my MongoDB version to 3.2 and it worked; very easy when you're using Docker-compose or K8's.