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
317 stars 82 forks source link

error with mongo in proccess phase #129

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello , I get the error below when I try to proccess the translation file:

/var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:1165:in rescue in generate_indexes': Failed to create index {:name=>"pre_mongified_id_1", :key=>{"pre_mongified_id"=>1}} with the following error: Database command 'createIndexes' failed: not authorized on admin to execute command { createIndexes: "movies", indexes: [ { name: "pre_mongified_id_1", key: { pre_mongified_id: 1 } } ] } (Mongo::OperationFailure) from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:1157:ingenerate_indexes' from /var/lib/gems/2.3.0/gems/mongo-1.12.5/lib/mongo/collection.rb:564:in create_index' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/database/no_sql_connection.rb:159:increate_pre_mongified_id_index' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/processor_common.rb:30:in block in setup_db_index' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/processor_common.rb:29:ineach' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/processor_common.rb:29:in setup_db_index' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/translation/process.rb:13:inprocess' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/cli/command/worker.rb:68:in execute' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/lib/mongify/cli/application.rb:28:inexecute!' from /var/lib/gems/2.3.0/gems/mongify-1.3.0/bin/mongify:15:in <top (required)>' from /usr/local/bin/mongify:23:inload' from /usr/local/bin/mongify:23:in `

'

my translation file is this one

table "genre", :ignore => true do column "id", :key, :as =>:integer column "movgenre", :text, :as => :string end

table "genres", :ignore => true do column "id", :key, :as => :integer column "genre", :string end

table "movie_genres", :ignore => true do column "movie", :integer column "genre", :integer end

table "movies" do column "id", :key, :as => :integer column "title", :string column "release_date", :string column "video", :string column "IMDBURL", :string end

table "ratings", :embed_in => :movies, :on => :movie do column "user", :integer, :references => :users column "movie", :integer, :references => :movies column "rating", :integer column "timestamp", :integer end

table "users" do column "id", :key, :as => :integer column "age", :integer column "gender", :string column "occupation", :string column "zip_code", :string end

any suggestions?

anlek commented 7 years ago

Seems like your mongoDB user doesn't have access to create indexes. Mongify requires to create indexes. Try fixing the permissions in MongoDB