allegro / allegro/ralph

issue importing rack information

Open
#3,358 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.5k
Forks
593
Avg merge
2d 9h
Merged PRs (30d)
6

Description

### Steps to reproduce

hi, i've encountered issue while try to import document(csv,json,xls)

![image](https://user-images.githubusercontent.com/44943949/50302190-a19d9300-0489-11e9-8117-70c5095b9588.png)
Django Version: 1.8.19
Python Version: 3.4.3
Installed Applications:
('ralph.admin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_rq',
'import_export',
'mptt',
'reversion',
'sitetree',
'ralph.accounts',
'ralph.assets',
'ralph.attachments',
'ralph.back_office',
'ralph.configuration_management',
'ralph.dashboards',
'ralph.data_center',
'ralph.dhcp',
'ralph.deployment',
'ralph.licences',
'ralph.domains',
'ralph.trade_marks',
'ralph.supports',
'ralph.security',
'ralph.lib.foundation',
'ralph.lib.table',
'ralph.networks',
'ralph.data_importer',
'ralph.dc_view',
'ralph.reports',
'ralph.virtual',
'ralph.operations',
'ralph.lib.external_services',
'ralph.lib.transitions',
'ralph.lib.permissions',
'ralph.lib.custom_fields',
'ralph.lib.hooks',
'ralph.notifications',
'ralph.ssl_certificates',
'rest_framework',
'rest_framework.authtoken',
'taggit',
'taggit_serializer')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'threadlocals.middleware.ThreadLocalMiddleware')

Traceback:
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3.4/contextlib.py" in inner
30. return func(*args, **kwds)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/decorators.py" in _wrapped_view
110. response = view_func(request, *args, **kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/sites.py" in inner
233. return view(request, *args, **kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/import_export/admin.py" in process_import
159. user=request.user)
File "/usr/lib/python3.4/contextlib.py" in inner
30. return func(*args, **kwds)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/import_export/resources.py" in import_data
395. six.reraise(*sys.exc_info())
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/six.py" in reraise
686. raise value
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/import_export/resources.py" in import_data
379. self.save_m2m(instance, row, real_dry_run)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/import_export/resources.py" in save_m2m
251. self.import_field(field, obj, data)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/import_export/resources.py" in import_field
230. field.save(obj, data)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/import_export/fields.py" in save
108. setattr(obj, attrs[-1], self.clean(data))
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/fields/related.py" in __set__
1261. "intermediary model. Use %s.%s's Manager instead." % (opts.app_label, opts.object_name)

Exception Type: AttributeError at /data_center/rack/process_import/
Exception Value: Cannot set values on a ManyToManyField which specifies an intermediary model. Use data_center.RackAccessory's Manager instead.

could you please help take a look where the issue is and how to fix it ?
### Expected behavior

file should be imported.

### Actual behavior

file failed importing

### Environment

root@ip-172-31-27-166:/opt/ralph/ralph-core/bin# dpkg -l "*ralph*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=======================================-========================-========================-====================================================================================
ii ralph-core 3.0.0-snapshot-20181109- amd64 Ralph is an DCIM/CMDB - asset management for Data Centers/ Back Office.
* Ralph version: Ralph 3
* Operating system: ubuntu 14.04
* Method of installation: follow the doc https://ralph-ng.readthedocs.io/en/latest/installation/installation/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.