Memory Error: Cannot create new nodes when running locally


#1

I have been trying to play around with sovrin locally, and I’ve been run into a bit of a wall starting up new nodes as per the tutorial here. When I run the following:

start_sovrin_node 9701 9702

I get this error:

Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/start_sovrin_node", line 46, in <module>
    cliha=cliha)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/sovrin_node/server/node.py", line 62, in __init__
    self.graphStore = self.getGraphStorage(name)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/sovrin_node/server/node.py", line 91, in getGraphStorage
    pyorient.DB_TYPE_GRAPH))
  File "/home/ubuntu/.local/lib/python3.5/site-packages/plenum/server/node.py", line 452, in _getOrientDbStore
    storageType=pyorient.STORAGE_TYPE_PLOCAL)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/plenum/persistence/orientdb_store.py", line 22, in __init__
    self.createDb(dbName, dbType, storageType)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/plenum/persistence/orientdb_store.py", line 36, in createDb
    self.client.db_create(dbName, dbType, storageType)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pyorient/orient.py", line 331, in db_create
    .prepare((name, type, storage)).send().fetch_response()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pyorient/messages/database.py", line 344, in fetch_response
    super(DbCreateMessage, self).fetch_response()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pyorient/messages/base.py", line 261, in fetch_response
    self._decode_all()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pyorient/messages/base.py", line 245, in _decode_all
    self._decode_header()
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pyorient/messages/base.py", line 172, in _decode_header
    serialized_exception = self._decode_field( FIELD_STRING )
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pyorient/messages/base.py", line 363, in _decode_field
    _decoded_string = self._orientSocket.read( _len )
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pyorient/orient.py", line 139, in read
    buf = bytearray(_len_to_read)
MemoryError
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/handlers.py", line 71, in emit
    if self.shouldRollover(record):
  File "/home/ubuntu/.local/lib/python3.5/site-packages/plenum/common/logging/TimeAndSizeRotatingFileHandler.py", line 20, in shouldRollover
    bool(RotatingFileHandler.shouldRollover(self, record))
  File "/usr/lib/python3.5/logging/handlers.py", line 185, in shouldRollover
    self.stream = self._open()
  File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
NameError: name 'open' is not defined
Call stack:
  File "/usr/lib/python3.5/asyncio/base_events.py", line 431, in __del__
    self.close()
  File "/usr/lib/python3.5/asyncio/unix_events.py", line 56, in close
    super().close()
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 98, in close
    super().close()
  File "/usr/lib/python3.5/asyncio/base_events.py", line 410, in close
    logger.debug("Close %r", self)
Message: 'Close %r'
Arguments: (<_UnixSelectorEventLoop running=False closed=False debug=True>,)

Any advice much appreciated!


#2

@william10 How much RAM do you have? Also what version of OrientDB are you running? Also version of pyorient, you can find it by doing pip freeze | grep pyorient


#3

@william10 Looking at the link you supplied, I’m assuming you installed the Sovrin software via pip. Is that correct? Along with the questions asked by lovesh, can you provide just a little more information on your environment. Is this a VM that you are running? Which version of Ubuntu are you running?


#4

@lovesh @trev - Thanks for the responses. I’ve installed Sovrin on an Amazon EC2 running Ubuntu 16.04 with 1 GB of RAM via pip. I’m running OrientDB version 2.2.17 and pyorient 1.5.4.


#5

@william10, since you are using Ubuntu, you may want to move over to installing via apt instead of pip, which will handle a lot more of the dependencies for you. Regarding the RAM, 1 GB is probably a little low to run the setup described in the document, though we should get @lovesh’s response to that, as that’s a setup he is more familiar with than I am. Alternatively, I could provide you with an AWS CloudFormation template that would set up a small Sovrin cluster for you. It’s not official in any way, but it is one that I use for my own testing.


#6

@trev - While we wait on @lovesh, would be happy to try out the CloudFormation template. As for installing via apt/pip, can sovrin be installed via apt?

apt-cache search sovrin

turns up no results. Or did you mean installing dependencies via apt?


#7

@william, with apt there are 2 packages to install, sovrin-node and sovrin-client, here is a google doc that describes it
https://docs.google.com/document/d/1fUrvt8rEekZmpfHjoeod7ZmWh3ISvSf-18vK5yTH6RY/edit#heading=h.16lpdsh8ojbu. Regarding the RAM, 1 GB is low considering the resource requirements of OrientDB which is required by nodes but soon we will we moving to a different database and then would be able to run with much less resources


#8

Thanks, @lovesh. I’ll give those instructions a go in a setup with a bit more RAM. What would you recommend as a minimum?


#9

2 GB at a minimum, 4 GB recommended.


#10

Thanks! Would definitely still be interested in checking out the CloudFormation template, @trev. Would definitely save some setup headaches.


#11

In that document:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D82D8E35
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EAA542E8

did not work for me and I used the following instead:

sudo wget -O - https://repo.evernym.com/deb/pubkey.gpg | sudo apt-key add -
sudo wget -O - https://repo.sovrin.org/deb/pubkey.gpg | sudo apt-key add -


#12

@fabienpe Thats surprising, i will have our build guy have a look at this. Thanks for reporting this.


#13

@fabienpe Can you provide the error message or other details? Our build confirmed it works for him, he is on Ubuntu 16.04


#14


#15

Hi!

Do you have a proxy?

Btw, your approach also good, may be we will change our docs.

sudo wget -O - https://repo.evernym.com/deb/pubkey.gpg | sudo apt-key add -
sudo wget -O - https://repo.sovrin.org/deb/pubkey.gpg | sudo apt-key add -

#16

Maybe that’s the reason. I’ll check with our IT guys.


#17

They confirmed it’s a firewall issue.


#18

Sorry for the delay here. I’ve published the template here: https://github.com/trevharmon/cloudformation-sovrin
Documentation is still a little sparse, but feel free to ask me questions.