allegro / ralph

Ralph is the CMDB / Asset Management system for data center and back office hardware.
https://ralph.allegro.tech/
Apache License 2.0
2.24k stars 550 forks source link

problem while Ralph 3.0 install #2975

Closed ziompaul closed 5 years ago

ziompaul commented 7 years ago

I have a problem while Ralph 3.0 Initialization.

When I try to type commands: _ralph migrate, ralph sitetree_resyncapps, ralph createsuperuser, it edns with an error:

PermissionError: [Errno 13] Permission denied: '/opt/ralph/ralph-core/lib/python3.4/site-packages/atomic/pycache/_cffi__xaa896a6dxf914a2ce.c'

What is the problem?

Regards

ar4s commented 7 years ago

Probably it's problem with metrology package. @romcheg can you confirm that?

romcheg commented 7 years ago

@ar4s the only way it could be related to metrology is that metrology or one of its dependencies use FFI and so require libffi to be installed. Since metrology was integrated into Ralph a while ago, I am not sure it is a root cause of the issue. Anyway, @ziompaul could you please verify libffi is installed.

ziompaul commented 7 years ago

Yes, libffi is installed. libffi

vi4m commented 7 years ago

Why we ship metrology in open source edition? It should be opt-in @romcheg

ziompaul commented 7 years ago

Always is thesame error, whatever i put with the ralph commad, the error is thesame. Full:

pszczecinski@skierlp01:~$ ralph
/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/contenttypes/mo                                                             dels.py:161: RemovedInDjango19Warning: Model class django.contrib.contenttypes.m                                                             odels.ContentType doesn't declare an explicit app_label and either isn't in an a                                                             pplication in INSTALLED_APPS or else was imported before its application was loa                                                             ded. This will no longer be supported in Django 1.9.
  class ContentType(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/models.py                                                             :28: RemovedInDjango19Warning: Model class django.contrib.admin.models.LogEntry                                                              doesn't declare an explicit app_label and either isn't in an application in INST                                                             ALLED_APPS or else was imported before its application was loaded. This will no                                                              longer be supported in Django 1.9.
  class LogEntry(models.Model):

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango                                                             19Warning: django.contrib.contenttypes.generic is deprecated and will be removed                                                              in Django 1.9. Its contents have been moved to the fields, forms, and admin sub                                                             modules of django.contrib.contenttypes.
  return f(*args, **kwds)

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango                                                             19Warning: The utilities in django.db.models.loading are deprecated in favor of                                                              the new application loading system.
  return f(*args, **kwds)

/opt/ralph/ralph-core/lib/python3.4/site-packages/taggit/models.py:96: RemovedIn                                                             Django19Warning: Model class taggit.models.Tag doesn't declare an explicit app_l                                                             abel and either isn't in an application in INSTALLED_APPS or else was imported b                                                             efore its application was loaded. This will no longer be supported in Django 1.9                                                             .
  class Tag(TagBase):

/opt/ralph/ralph-core/lib/python3.4/site-packages/taggit/models.py:201: RemovedI                                                             nDjango19Warning: Model class taggit.models.TaggedItem doesn't declare an explic                                                             it app_label and either isn't in an application in INSTALLED_APPS or else was im                                                             ported before its application was loaded. This will no longer be supported in Dj                                                             ango 1.9.
  class TaggedItem(GenericTaggedItemBase, TaggedItemBase):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/auth/models.py:                                                             41: RemovedInDjango19Warning: Model class django.contrib.auth.models.Permission                                                              doesn't declare an explicit app_label and either isn't in an application in INST                                                             ALLED_APPS or else was imported before its application was loaded. This will no                                                              longer be supported in Django 1.9.
  class Permission(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/auth/models.py:                                                             98: RemovedInDjango19Warning: Model class django.contrib.auth.models.Group doesn                                                             't declare an explicit app_label and either isn't in an application in INSTALLED                                                             _APPS or else was imported before its application was loaded. This will no longe                                                             r be supported in Django 1.9.
  class Group(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/auth/models.py:                                                             436: RemovedInDjango19Warning: Model class django.contrib.auth.models.User doesn                                                             't declare an explicit app_label and either isn't in an application in INSTALLED                                                             _APPS or else was imported before its application was loaded. This will no longe                                                             r be supported in Django 1.9.
  class User(AbstractUser):

Traceback (most recent call last):
  File "/opt/ralph/ralph-core/bin/ralph", line 9, in <module>
    load_entry_point('ralph==3.0.0', 'console_scripts', 'ralph')()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/__main__.py", li                                                             ne 29, in prod
    main('ralph.settings.prod')
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/__main__.py", li                                                             ne 14, in main
    execute_from_command_line(sys.argv)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management                                                             /__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management                                                             /__init__.py", line 328, in execute
    django.setup()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/__init__.py", l                                                             ine 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/apps/registry.p                                                             y", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/apps/config.py"                                                             , line 112, in create
    mod = import_module(mod_path)
  File "/opt/ralph/ralph-core/lib/python3.4/importlib/__init__.py", line 109, in                                                              import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/notifications/ap                                                             ps.py", line 5, in <module>
    from ralph.notifications.sender import send_notification_for_model
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/notifications/se                                                             nder.py", line 7, in <module>
    from metrology import Metrology
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/metrology/__init__.py"                                                             , line 1, in <module>
    from metrology.registry import registry
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/metrology/registry.py"                                                             , line 6, in <module>
    from metrology.instruments import Counter, Derive, Meter, Timer, Utilization                                                             Timer, HistogramUniform
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/metrology/instruments/                                                             __init__.py", line 2, in <module>
    from metrology.instruments.counter import Counter
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/metrology/instruments/                                                             counter.py", line 1, in <module>
    from atomic import AtomicLong
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/atomic/__init__.py", l                                                             ine 32, in <module>
    """)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/cffi/api.py", line 437                                                             , in verify
    lib = self.verifier.load_library()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/cffi/verifier.py", lin                                                             e 112, in load_library
    self._write_source()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/cffi/verifier.py", lin                                                             e 201, in _write_source
    with open(self.sourcefilename, "w") as fp:
PermissionError: [Errno 13] Permission denied: '/opt/ralph/ralph-core/lib/python                                                             3.4/site-packages/atomic/__pycache__/_cffi__xaa896a6dxf914a2ce.c'
mkurek commented 7 years ago

@ziompaul what OS and in what architecture are you using to install ralph?

ziompaul commented 7 years ago

It is Ubuntu Server 14.04.5 LTS - ubuntu-14.04.5-server-amd64.iso.

vi4m commented 7 years ago

/opt/ralph/ralph-core/ is not writable for users. If you run it as root it will probably works fine. It seems cffi tries to write to some files in this location.

vi4m commented 7 years ago

We should think about

a) maintain proper permissions during the installation b) decide if we should run as root or normal user. Most of the people still uses root account.

ziompaul commented 7 years ago

OK, there were some difficulties, because by default the root account was not configured during the Ubuntu installation (not known password), login to root by ssh/winscp was blocked, but after I beat the problems, I have installed the Ralph again on root, and then the inicialization went good.

ziompaul commented 7 years ago

Is there a possibility to run the ralphserver in background?

mkurek commented 7 years ago

If you want to run it temporarily, use screen or something similar. If you want it to be persistent, try supervisord or nginx (and try with gunicorn instead of runserver - runserver should be used only to development: http://docs.gunicorn.org/en/stable/deploy.html)

romcheg commented 5 years ago

Closing a stale issue. If it is still relevant, please re-open it or start a topic at Ralph forum: https://ralph.discourse.group