Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update failed error in - mongify process command #124

Open
jyotman opened this issue Dec 5, 2016 · 8 comments
Open

Update failed error in - mongify process command #124

jyotman opened this issue Dec 5, 2016 · 8 comments

Comments

@jyotman
Copy link

jyotman commented Dec 5, 2016

I'm getting an error using the mongify process command.
All the data is copied to MongoDB from PostgreSQL but the respective foreign key ids are not updated.

This is the error I get -

Copying projects (1/1): (1387/1387) 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Copying users (1/1): (1763/1763) 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 Updating References projects: (1387/1387) 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:03 Updating References users: (1763/1763) 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:02 /var/lib/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 /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/db.rb:606:in 'command' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:314:in 'block in send_write_command' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:55:in 'block in instrument' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:20:in 'instrument' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:54:in 'instrument' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:313:in 'send_write_command' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:1104:in 'send_write' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:497:in 'update' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/database/no_sql_connection.rb:145:in 'remove_pre_mongified_ids' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/processor_common.rb:116:in 'block in remove_pre_mongified_ids' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/processor_common.rb:114:in 'each' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/processor_common.rb:114:in 'remove_pre_mongified_ids' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/translation/process.rb:18:in 'process' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/cli/command/worker.rb:72:in 'execute' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/lib/mongify/cli/application.rb:28:in 'execute!' from /var/lib/gems/2.3.0/gems/mongify-1.3.1/bin/mongify:15:in '<top (required)>' from /usr/local/bin/mongify:23:in 'load' from /usr/local/bin/mongify:23:in '<main>'

This is my translation file -

table "projects" do
	column "project_id", :integer, :references => "projects"
	column "projectname", :string
	column "description", :text
	column "link", :string
	column "created_on", :datetime
	column "updated_on", :datetime
	column "project_image_ratio", :float
	column "project_image_url", :string
	column "owner_id", :integer, :references => "users"
end

table "users" do
	column "user_id", :integer, :references => "users"
	column "username", :string
	column "email", :string
	column "location", :string
	column "about_me", :text
	column "created_on", :datetime
	column "updated_on", :datetime
	column "password_hash", :string
	column "user_image_ratio", :float
	column "user_image_url", :string
	column "phone_number", :string
	column "email_verified", :boolean
	column "registered", :boolean
	column "phone_number_verified", :boolean
	column "feedback_message", :string
	column "first_name", :string
	column "last_name", :string
	column "handle", :string
	column "city", :string
	column "country", :string
	column "extension", :string
	column "fcm_token", :string
	column "feedback", :string
	column "is_new_user", :string
	column "new_user_status", :string
	column "show_feedback_dialog", :string
	column "current_app_version", :integer
	column "last_notification_time", :string
end

This is the database.config file -

sql_connection do
  adapter     "postgresql"
  host        "localhost"
  username    "******"
  password    "******"
  database    "*******"
  batch_size  10000
end

mongodb_connection do
  host        "localhost"
  database    "**********"
end
@jyotman jyotman changed the title Update failed in error in mongify process Update failed error in - mongify process command Dec 5, 2016
@ibotdotout
Copy link

ibotdotout commented Dec 27, 2016

I got the same problem. I try to rollback Mongo database from version 3.4 to 3.2 and the error is gone.

@artjomg
Copy link

artjomg commented Jan 30, 2017

any fixes planned for this?

@anlek
Copy link
Owner

anlek commented Feb 10, 2017

Hey @artjomg, I'm unable to dedicate time to fix this at the moment, but will gladly review pull requests.

@optimus93
Copy link

Done ... downgrading to 3.2 works.. no more errors...evrything running smooth ..thnks

@optimus93
Copy link

@anlek - hey brother... can we merge columns of two different tables in mongify ?

@anlek
Copy link
Owner

anlek commented Feb 15, 2017

@optimus93 Yes, you can, by embedding one into the other, and using the before_save method and pushing the values to parent_row. Read the docs to learn more.

@rodrigotrombeta
Copy link

Dear @anlek ,
Nowadays MongoDB lowest version is 4.4 (and it's not possible to use MongoDB version 3.2 anymore due to it's end of life being on 2018). Given that the problem mentioned in this issue came up again and once the downgrade is not a solution anymore. Is it possible to have another fix/workaround for that issue?
Thanks in advance.

@anlek
Copy link
Owner

anlek commented Sep 11, 2021

Unfortunately, I don't have a solution at this time. If I had more time, I might be able to upgrade the dependencies. However, life is a bit busier these days then it used to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants