2016-04-29 18 views
0

jsonファイルをGoogle Cloud ComputeインスタンスのRethinkDBにインポートしようとしてエラーが発生しましたが、このエラーの原因はわかりません。どんな助けもありがとうございます。RethinkDBにインポート中にエラーが発生しました

[email protected]:~# rethinkdb import -f users_0.json --table test.users 
Traceback (most recent call last): 
    File "/usr/local/bin/rethinkdb-import", line 9, in <module> 
    load_entry_point('rethinkdb==2.3.0.post1', 'console_scripts', 'rethinkdb-import')() 
    File "/usr/local/lib/python2.7/dist-packages/rethinkdb/_import.py", line 929, in main 
    import_file(options) 
    File "/usr/local/lib/python2.7/dist-packages/rethinkdb/_import.py", line 904, in import_file 
    pkey = rdb_call_wrapper(conn_fn, "table check", table_check, db, table, options["create_args"], options["force"]) 
    File "/usr/local/lib/python2.7/dist-packages/rethinkdb/_backup.py", line 78, in rdb_call_wrapper 
    return fn(progress, conn, *args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/rethinkdb/_import.py", line 885, in table_check 
if not options["quiet"]: 
NameError: global name 'options' is not defined 

RethinkDBはDockerと同じVM上で実行されています。

docker run -i -t -p 8080:8080 -p 28015:28015 -p 29015:29015 rethinkdb 
+0

こんにちは@BenSimmons、このコメントの説明に従ってPythonドライバを更新して、もう一度お試しください。このバグは残念です! https://github.com/rethinkdb/rethinkdb/issues/5736#issuecomment-215922401 – dalanmiller

答えて

0

彼らは定義していない変数を使用しています。私はそのバージョンのコード2.3.0.post1をpypiから取り出しました(以下のバグの機能が含まれています)。私もバージョン2.2.0.post2をチェックしました。そのバグは表示されないので、そのパッケージをダウングレードしてください。

def table_check(progress, conn, db, table, create_args, force): 
    pkey = None 

if db == "rethinkdb": 
    raise RuntimeError("Error: Cannot import a table into the system database: 'rethinkdb'") 

if db not in r.db_list().run(conn): 
    r.db_create(db).run(conn) 

if table in r.db(db).table_list().run(conn): 
    if not force: 
     raise RuntimeError("Error: Table already exists, run with --force if you want to import into the existing table") 

    if 'primary_key' in create_args: 
     pkey = r.db(db).table(table).info()["primary_key"].run(conn) 
     if create_args["primary_key"] != pkey: 
      raise RuntimeError("Error: Table already exists with a different primary key") 
else: 
    if 'primary_key' in create_args: 
     pkey = create_args["primary_key"] 
    else: 
     if not options["quiet"]: 
      print("no primary key specified, using default primary key when creating table") 
    r.db(db).table_create(table, **create_args).run(conn) 

return pkey 
関連する問題