Bigchaindb: Syntax error on bigchaindb call in console

Created on 14 Nov 2017  路  4Comments  路  Source: bigchaindb/bigchaindb

  • BigchainDB version: can't get the version since the command bigchaindb fails w/o parameters, but should be latest at the time of this writing, i.e. v. 1.2.0
  • Operating System: Ubuntu 17.10
  • Deployment Type: [Host]
  • BigchainDB driver: [yes]

    • If using a driver please specify, driver type [python]

      and version.

Description

The error started to happen "out of blue". One day bigchain was working normally, the next day it won't start anymore. I've stopped mongodb service and restarted it again with -replSet=bigchain-rs and tried again with the same error.

What I Did

When I issue bigchaindb in linux terminal w/o arguments, I get the following syntax error:

Traceback (most recent call last):
  File "/usr/local/bin/bigchaindb", line 11, in <module>
    load_entry_point('BigchainDB==1.1.0', 'console_scripts', 'bigchaindb')()
  File "/home/darko/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/darko/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2769, in load_entry_point
    return ep.load()
  File "/home/darko/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2422, in load
    return self.resolve()
  File "/home/darko/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2428, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.6/dist-packages/bigchaindb/__init__.py", line 110, in <module>
    from bigchaindb.core import Bigchain  # noqa
  File "/usr/local/lib/python3.6/dist-packages/bigchaindb/core.py", line 7, in <module>
    from bigchaindb.common.utils import gen_timestamp, serialize
  File "/usr/local/lib/python3.6/dist-packages/bigchaindb/common/utils.py", line 3, in <module>
    import rapidjson
  File "/usr/local/lib/python3.6/dist-packages/uuid.py", line 138
    if not 0 <= time_low < 1<<32L:
                                ^
SyntaxError: invalid syntax

Most helpful comment

Thanks for the reply. I've done pip uninstall uuid (just in case) and pip3 uninstall uuid and it did work. I think that it has something to do with the fact that uuid is now a built-in python package. Anyway, the issue had to do with the uuid modul. I'm closing the issue. Thanks again.

All 4 comments

Hmm, that's very strange. I'm actually running Ubuntu 17.10 myself these days, so I tried to reproduce your problem just now.

$ cd
$ mkdir temp_bigchaindb
$ cd temp_bigchaindb/
$ which python3
/usr/bin/python3
$ virtualenv -p /usr/bin/python3 bc
$ . bc/bin/activate
(bc) $ pip install bigchaindb
...
(bc) $ bigchaindb -v
bigchaindb 1.2.0
(bc) $ python
Python 3.6.3 (default, Oct  3 2017, 21:45:48) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
(bc) $ bigchaindb -y configure mongodb
Generating keypair
Generating default configuration for backend mongodb
Configuration written to /home/troy/.bigchaindb
Ready to go!
(bc) $ # note that I already have MongoDB running
(bc) $ bigchaindb start
INFO:bigchaindb.config_utils:Configuration loaded from `/home/troy/.bigchaindb`
[2017-11-14 11:22:11] [INFO] (bigchaindb.commands.bigchaindb) BigchainDB Version 1.2.0 (MainProcess - pid: 1855)
[2017-11-14 11:22:11] [INFO] (bigchaindb.commands.bigchaindb) Initializing database (MainProcess - pid: 1855)
...

Anyway, it all seemed to work fine.

I noticed that the problem for you happened with File "/usr/local/lib/python3.6/dist-packages/uuid.py", line 138

Maybe you could try updating the uuid package (using pip or whatever)?

https://pypi.python.org/pypi/uuid

Thanks for the reply. I've done pip uninstall uuid (just in case) and pip3 uninstall uuid and it did work. I think that it has something to do with the fact that uuid is now a built-in python package. Anyway, the issue had to do with the uuid modul. I'm closing the issue. Thanks again.

uuid is bundled with python since version 2.5, you should not install it in your virtual environment.

uuid is bundled with python since version 2.5, you should not install it in your virtual environment.

Yup. Uninstalling uuid via pip sorted this for me.

Was this page helpful?
0 / 5 - 0 ratings