Git Product home page Git Product logo

Comments (26)

sawdog avatar sawdog commented on June 10, 2024 1

I wasn't aware we were trying for backwards compatibility with 2.7; for some reason - I dunno why.
The issue with -p is not the port; it's looking to set a password. That should be easy enough
to fix and can also account for the other args that were broken/breaking. I did not look at them all at the time. I'll try and get a look at that tomorrow. The lack of tests is really a sub optimal scenario.

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024 1

@shuat just pip install rethinkdb==2.3.0.post6. All the previous versions are available on PyPi (https://pypi.org/project/rethinkdb/#history)

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

@shuat Hello, it seems that the import/dump/... commands are broken. As I have time I’ll look into this.

from rethinkdb-python.

shuat avatar shuat commented on June 10, 2024

@gabor-boros Thanks for the quick answer. Is there any workaround for backing up my DB?

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

@shuat Can you confirm that you installed 2.4.1?

As I guess there is no workaround yet, except downgrading to version 2.3.x temporary.

I’ll look into the issue today or tomorrow.

from rethinkdb-python.

psschroeter avatar psschroeter commented on June 10, 2024

Also having this issue with a slightly different option (TypeError: check_tls_option() takes exactly 2 arguments (3 given)). 2.4.0 and 2.4.1 both error out. 2.3.0 seems to work.

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

@psschroeter thanks for reporting, we definitely need to look into this issue as soon as we can

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

@psschroeter @shuat There are several issues. The first issue is that the -c flag is not working. I do not know yet why, but it is not. The second issue is that multiprocessing has no get_context in python 2.7.x.

If it is not enough, then there are other broken things as well. We have two options:

  1. Diff the changes between master and e801bb5 (this commit contains a working dump functionality but the -c flag issue is there as well).
  2. Due to the dump/import/etc.. functionalities are not tested, and not well-organized we could refactor/rewrite it from zero and write a ton of unit/integration tests around it. Although I'm not a big fan of rewrite things like this I would vote for this.

What do you think @grandquista ?

from rethinkdb-python.

sawdog avatar sawdog commented on June 10, 2024

I'm confused again. I told you I fixed this

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

@sawdog here is the change what you provided: 086a768 but it does not fixed the issue

from rethinkdb-python.

Stilldabomb avatar Stilldabomb commented on June 10, 2024

-p also throws an error, and for some reason it's not accepting the first argument passed to it, figured this applied to this issue.

backend git:(master) ✗ rethinkdb dump - -p
Password for `admin`:
Traceback (most recent call last):
  File "/usr/local/bin/rethinkdb-dump", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/rethinkdb/_dump.py", line 143, in main
    options = parse_options(argv or sys.argv[2:], prog=prog)
  File "/usr/local/lib/python3.7/site-packages/rethinkdb/_dump.py", line 94, in parse_options
    options, args = parser.parse_args(argv)
  File "/usr/local/lib/python3.7/site-packages/rethinkdb/utils_common.py", line 359, in parse_args
    options, args = super(CommonOptionsParser, self).parse_args(*args, **kwargs)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/optparse.py", line 1387, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/optparse.py", line 1431, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/optparse.py", line 1536, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/optparse.py", line 785, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/local/lib/python3.7/site-packages/rethinkdb/utils_common.py", line 249, in take_action
    values[dest] = getpass.getpass('Password for `admin`: ')
TypeError: 'Values' object does not support item assignment

from rethinkdb-python.

shuat avatar shuat commented on June 10, 2024

@shuat Can you confirm that you installed 2.4.1?

As I guess there is no workaround yet, except downgrading to version 2.3.x temporary.

I’ll look into the issue today or tomorrow.

@gabor-boros Sorry for the slow reply
This is what I have /usr/local/lib/python3.4/dist-packages (2.4.1) So yes I have 2.4.1

from rethinkdb-python.

shuat avatar shuat commented on June 10, 2024

@gabor-boros Where can I get an old version? Seems pip only has one version

root@bd07b97dd7c9:/data# yolk -V rethinkdb
rethinkdb 2.4.1

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

@shuat @Stilldabomb @grandquista it seems that I was able to fix the issue (will be merged soon) but the first argument is not picked up. I can not locate the issue, but the workaround until we figure it out will be: rethinkdb dump - -c host:port. (please note the - after the dump/import)

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

The issue will be fixed by #106

from rethinkdb-python.

Upd4ting avatar Upd4ting commented on June 10, 2024

Could wee know once the update has been pushed?

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

I’m waiting for the review of @grandquista

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

So it is merged. There are 2 other issues what we should resolve before the release, but I'll keep this issue updated

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

All the other issues are resolved. I’ll do the release during the weekend or Monday

from rethinkdb-python.

gabor-boros avatar gabor-boros commented on June 10, 2024

V2.4.2 is out containing for for this issue

from rethinkdb-python.

Upd4ting avatar Upd4ting commented on June 10, 2024

Good job!

from rethinkdb-python.

frafra avatar frafra commented on June 10, 2024

Mmm... rethinkdb-dump now requires dump as first argument, while in 2.3.0* it wasn't needed.

from rethinkdb-python.

andreaspeters avatar andreaspeters commented on June 10, 2024

Well, I have the same error message like @shuat.

$ rethinkdb-dump dump -c 172.23.0.2:28015  --password-file pw.txt
Traceback (most recent call last):
  File "/usr/bin/rethinkdb-dump", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.7/site-packages/rethinkdb/_dump.py", line 143, in main
    options = parse_options(argv or sys.argv[2:], prog=prog)
  File "/usr/lib/python3.7/site-packages/rethinkdb/_dump.py", line 94, in parse_options
    options, args = parser.parse_args(argv)
  File "/usr/lib/python3.7/site-packages/rethinkdb/utils_common.py", line 359, in parse_args
    options, args = super(CommonOptionsParser, self).parse_args(*args, **kwargs)
  File "/usr/lib/python3.7/optparse.py", line 1387, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python3.7/optparse.py", line 1427, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python3.7/optparse.py", line 1501, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python3.7/optparse.py", line 779, in process
    value = self.convert_value(opt, value)
  File "/usr/lib/python3.7/optparse.py", line 771, in convert_value
    return self.check_value(opt, value)
  File "/usr/lib/python3.7/optparse.py", line 766, in check_value
    return checker(self, opt, value)
TypeError: file_contents() takes 2 positional arguments but 3 were given

And thats with the current python-rethinkdb version:

$ pip list | grep rethink
rethinkdb                                       2.4.2.post1

With the version 2.3.6 is it working quite well:

$ rethinkdb-dump -c 172.23.0.2:28015  --password-file pw.txt
NOTE: 'rethinkdb-dump' saves data and secondary indexes, but does *not* save
 cluster metadata.  You will need to recreate your cluster setup yourself after
 you run 'rethinkdb-restore'.
Exporting to directory...
[========================================] 100%
68 rows exported from 4 tables, with 0 secondary indexes
  Done (0 seconds)
Zipping export directory...
  Done (0 seconds)

from rethinkdb-python.

Markus00000 avatar Markus00000 commented on June 10, 2024

Version 2.4.2.post1 does not work for me while 2.3.0.post6 does.

$ pip install rethinkdb==2.3.0.post6
[...]
$ rethinkdb dump --connect localhost:28015 --password --export test.users
NOTE: 'rethinkdb-dump' saves data and secondary indexes, but does *not* save
 cluster metadata.  You will need to recreate your cluster setup yourself after 
 you run 'rethinkdb-restore'.
Exporting to directory...
Password for `admin`: 
[========================================] 100% 
38 rows exported from 1 table, with 2 secondary indexes
  Done (0 seconds)
Zipping export directory...
  Done (0 seconds)

$ pip install rethinkdb==2.4.2.post1
[...]
$ rethinkdb dump --connect localhost:28015 --password --export test.users
Password for `admin`: 
Traceback (most recent call last):
  File "/srv/http/test/venv/bin/rethinkdb-dump", line 10, in <module>
    sys.exit(main())
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/_dump.py", line 143, in main
    options = parse_options(argv or sys.argv[2:], prog=prog)
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/_dump.py", line 94, in parse_options
    options, args = parser.parse_args(argv)
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/utils_common.py", line 359, in parse_args
    options, args = super(CommonOptionsParser, self).parse_args(*args, **kwargs)
  File "/usr/lib/python3.5/optparse.py", line 1386, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python3.5/optparse.py", line 1426, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python3.5/optparse.py", line 1500, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python3.5/optparse.py", line 784, in process
    self.action, self.dest, opt, value, values, parser)
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/utils_common.py", line 249, in take_action
    values[dest] = getpass.getpass('Password for `admin`: ')
TypeError: 'Values' object does not support item assignment
$ rethinkdb dump - --connect localhost:28015 --password --export test.users
Password for `admin`: 
Traceback (most recent call last):
  File "/srv/http/test/venv/bin/rethinkdb-dump", line 10, in <module>
    sys.exit(main())
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/_dump.py", line 143, in main
    options = parse_options(argv or sys.argv[2:], prog=prog)
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/_dump.py", line 94, in parse_options
    options, args = parser.parse_args(argv)
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/utils_common.py", line 359, in parse_args
    options, args = super(CommonOptionsParser, self).parse_args(*args, **kwargs)
  File "/usr/lib/python3.5/optparse.py", line 1386, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python3.5/optparse.py", line 1426, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python3.5/optparse.py", line 1500, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python3.5/optparse.py", line 784, in process
    self.action, self.dest, opt, value, values, parser)
  File "/srv/http/test/venv/lib/python3.5/site-packages/rethinkdb/utils_common.py", line 249, in take_action
    values[dest] = getpass.getpass('Password for `admin`: ')
TypeError: 'Values' object does not support item assignment

from rethinkdb-python.

atomicules avatar atomicules commented on June 10, 2024

Per this comment and:

TypeError: file_contents() takes 2 positional arguments but 3 were given

It seems that what happens is --password-file gets sent twice. So from utils_common.py:

def file_contents(opt_str, value):
  • opt_str is --password-file
  • value is --password-file
  • and the third argument is the actual file location.

Don't know why that is though. Changes in optparse? Incompatibilities in python2?

For the record this is on an older version of python (2.7.6) using 2.4.2 of this driver.

from rethinkdb-python.

sawdog avatar sawdog commented on June 10, 2024

Is this being worked on? Otherwise I can resolve it - just assigned to me.

from rethinkdb-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.