rethinkdb-python icon indicating copy to clipboard operation
rethinkdb-python copied to clipboard

rethinkdb restore failing after upgrade to 2.4.7 (TypeError: 'Values' object is not subscriptable)

Open mishawakerman opened this issue 5 years ago • 2 comments

Describe the bug Restore fails if the --temp-dir argument is provided.

To Reproduce Steps to reproduce the behavior: Try to restore with (valid directory) --temp-dir argument and see the following error:

Traceback (most recent call last):,
  File '/usr/local/bin/rethinkdb-restore', line 11, in <module>,
    sys.exit(main()),
  File '/usr/local/lib/python3.5/dist-packages/rethinkdb/_restore.py', line 336, in main,
    options = parse_options(argv, prog=prog),
  File '/usr/local/lib/python3.5/dist-packages/rethinkdb/_restore.py', line 183, in parse_options,
    if not os.access(options['temp_dir'], os.W_OK):,

TypeError: 'Values' object is not subscriptable,
Command exited with non-zero status 1,
	Command being timed: 'rethinkdb restore -i atticus_uk --temp-dir /data/backups --force /data/backups/atticus_uk.tar.gz',
	User time (seconds): 0.14,
	System time (seconds): 0.03,
	Percent of CPU this job got: 99%,

Expected behavior Restore the database.

System info

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

$ python --version
Python 3.5.2

$ rethinkdb --version
rethinkdb 2.4.0~0xenial (GCC 5.4.0)

$ pip3 show rethinkdb
---
Metadata-Version: 2.1
Name: rethinkdb
Version: 2.4.7
Summary: Python driver library for the RethinkDB database server.
Home-page: https://github.com/RethinkDB/rethinkdb-python
Author: None
Author-email: None
Installer: pip
License: UNKNOWN
Location: /usr/local/lib/python3.5/dist-packages
Requires: six
Classifiers:
  Intended Audience :: Developers
  Natural Language :: English
  Programming Language :: Python :: 2
  Programming Language :: Python :: 2.7
  Programming Language :: Python :: 3
  Programming Language :: Python :: 3.5
  Programming Language :: Python :: 3.6
  Programming Language :: Python :: 3.7
  Programming Language :: Python :: 3.8
Entry-points:
  [console_scripts]
  rethinkdb-dump = rethinkdb._dump:main
  rethinkdb-export = rethinkdb._export:main
  rethinkdb-import = rethinkdb._import:main
  rethinkdb-index-rebuild = rethinkdb._index_rebuild:main
  rethinkdb-repl = rethinkdb.__main__:startInterpreter
  rethinkdb-restore = rethinkdb._restore:main

Additional context It looks like a typo on _restore.py:183, which should be options.temp_dir. PR to follow.

mishawakerman avatar Jun 01 '20 05:06 mishawakerman

For anyone else having this issue, our workaround was to go back to rethinkdb==2.3.0.post6 (the same issue appears to be present in 2.4.0).

mishawakerman avatar Jun 01 '20 05:06 mishawakerman

Perhaps would've been caught with #172

mishawakerman avatar Jun 01 '20 05:06 mishawakerman