Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTTP/1.1 500 INTERNAL SERVER ERROR
- Server: nginx/1.6.2
- Date: Thu, 07 May 2015 06:19:16 GMT
- Content-Type: text/plain; charset=utf-8
- Content-Length: 9470
- Connection: keep-alive
- Content-Language: en
- Expires: 0
- Vary: Accept-Language, Cookie
- Pragma: no-cache
- Cache-Control: no-cache
- UNHANDLED EXCEPTION (2015-05-07 09:19:16.541411)
- BRANCH: develop TIP: c397b9b780df
- PROCESS: ./scripts/noc-web.py
- ERROR FINGERPRINT: 47753de5-47fb-58b1-8f01-733c56f907a4
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'mongoengine.errors.OperationError'> Could not save document (Cannot update 'data.rackmount.side' and 'data.rackmount' at the same time)
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/mongoengine/document.py (Line: 367)
- Function: save
- 360 except pymongo.errors.OperationFailure, err:
- 361 message = 'Could not save document (%s)'
- 362 if re.match('^E1100[01] duplicate key', unicode(err)):
- 363 # E11000 - duplicate key error index
- 364 # E11001 - duplicate key on update
- 365 message = u'Tried to save duplicate unique keys (%s)'
- 366 raise NotUniqueError(message % unicode(err))
- 367 ==> raise OperationError(message % unicode(err))
- 368 id_field = self._meta['id_field']
- 369 if created or id_field not in self._meta.get('shard_key', []):
- 370 self[id_field] = self._fields[id_field].to_python(object_id)
- 371
- 372 signals.post_save.send(self.__class__, document=self, created=created)
- 373 self._clear_changed_fields()
- Variables:
- removals = {}
- force_insert = False
- write_concern = {'w': 1}
- message = 'Could not save document (%s)'
- update_query =
- {'$set': {'data.rackmount': {'position': 9, 'side': 'f'},
- 'data.rackmount.position': 9,
- 'data.rackmount.side': 'f'}}
- self = <Object: qwe-CR01>
- _refs = None
- object_id = ObjectId('550acbb8d71f0b5a530fd695')
- kwargs = {}
- save_condition = None
- clean = True
- is_new_object = <function is_new_object at 0x6ff3140>
- select_dict = {'_id': ObjectId('550acbb8d71f0b5a530fd695')}
- collection =
- Collection(Database(MongoClient('localhost', 27017), u'noc'), u'noc.objects')
- updates =
- {'data.rackmount': {'position': 9, 'side': 'f'},
- 'data.rackmount.position': 9,
- 'data.rackmount.side': 'f'}
- validate = True
- err =
- OperationFailure(u"Cannot update 'data.rackmount.side' and 'data.rackmount' at the same time",)
- created = False
- doc =
- SON([('_id', ObjectId('550acbb8d71f0b5a530fd695')), ('name', u'SP00MSC4-CR01'), ('model', ObjectId('55067820d71f0b4fd7227859')), ('data', {u'management': {u'managed_object': 12}, u'asset': {u'serial': u'111', u'revision': u'V04'}, 'rackmount': {'position': 9, 'side': 'f'}}), ('container', ObjectId('554b037ad71f0b10cf9a2391'))])
- shard_key = ()
- cascade = None
- cascade_kwargs = None
- upsert = True
- ------------------------------------------------------------------------
- File: inv/apps/inv/plugins/rack.py (Line: 79)
- Function: api_set_rack_load
- 72 o = self.app.get_object_or_404(Object, id=id)
- 73 co = self.app.get_object_or_404(Object, id=cid)
- 74 if co.container != o.id:
- 75 return self.app.response_not_found()
- 76 if position_front:
- 77 co.set_data("rackmount", "position", position_front)
- 78 co.set_data("rackmount", "side", "f")
- 79 ==> co.save()
- 80 co.log(
- 81 "Set rack position to front #%d" % position_front,
- 82 user=request.user.username, system="WEB",
- 83 op="CHANGE"
- 84 )
- 85 elif position_rear:
- Variables:
- position_rear = 0
- co = <Object: SP00MSC4-CR01>
- cid = '550acbb8d71f0b5a530fd695'
- shift = 0
- self = <noc.inv.apps.inv.plugins.rack.RackPlugin object at 0x58f0690>
- request =
- <WSGIRequest
- path:/inv/inv/554b037ad71f0b10cf9a2391/plugin/rack/rackload/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {u'{"cid":"550acbb8d71f0b5a530fd695","position_front":9,"position_rear":0,"shift":0}': [u'']}>,
- COOKIES:{'csrftoken': 'YGvzneuTfIGFmS7UfPEilltKwJHpi1Wn',
- 'sessionid': 'c025854d94dcb2e5a9e2102fc4b0e208'},
- META:{'CONTENT_LENGTH': '81',
- 'CONTENT_TYPE': 'application/json; charset=UTF-8',
- 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
- 'HTTP_CACHE_CONTROL': 'no-cache',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=c025854d94dcb2e5a9e2102fc4b0e208; csrftoken=YGvzneuTfIGFmS7UfPEilltKwJHpi1Wn',
- 'HTTP_HOST': '10.87.177.58',
- 'HTTP_PRAGMA': 'no-cache',
- 'HTTP_REFERER': 'http://10.87.177.58/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'HTTP_X_SCHEME': 'http',
- 'PATH_INFO': u'/inv/inv/554b037ad71f0b10cf9a2391/plugin/rack/rackload/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'POST',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '10.87.177.58',
- 'SERVER_PORT': '80',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x2dda1e0>,
- 'wsgi.input': <_io.BytesIO object at 0x6fcc0b0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- o = <Object: TEST>
- id = u'554b037ad71f0b10cf9a2391'
- position_front = 9
- ------------------------------------------------------------------------
- File: lib/app/site.py (Line: 248)
- Function: inner
- 241 a = dict((k, v[0] if len(v) == 1 else v)
- 242 for k, v in request.GET.lists())
- 243 app_logger.debug("API %s %s %s",
- 244 request.method, request.path, a)
- 245 # Call handler
- 246 v.__dict__["hits_metric"] += 1
- 247 with v.__dict__["time_metric"].timer():
- 248 ==> r = v(request, *args, **kwargs)
- 249 # Dump SQL statements
- 250 if self.log_sql_statements:
- 251 from django.db import connections
- 252 tsc = 0
- 253 sc = defaultdict(int)
- 254 for conn in connections.all():
- Variables:
- errors = None
- view_map = {'POST': <functools.partial object at 0x58f2470>}
- Form = <class 'django.forms.forms.Form'>
- g =
- {'cid': '550acbb8d71f0b5a530fd695',
- 'position_front': 9,
- 'position_rear': 0,
- 'shift': 0}
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- kwargs =
- {'cid': '550acbb8d71f0b5a530fd695',
- 'id': u'554b037ad71f0b10cf9a2391',
- 'position_front': 9,
- 'position_rear': 0,
- 'shift': 0}
- self = <noc.lib.app.site.Site object at 0x32cbf50>
- to_log_api_call = False
- args = ()
- request =
- <WSGIRequest
- path:/inv/inv/554b037ad71f0b10cf9a2391/plugin/rack/rackload/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {u'{"cid":"550acbb8d71f0b5a530fd695","position_front":9,"position_rear":0,"shift":0}': [u'']}>,
- COOKIES:{'csrftoken': 'YGvzneuTfIGFmS7UfPEilltKwJHpi1Wn',
- 'sessionid': 'c025854d94dcb2e5a9e2102fc4b0e208'},
- META:{'CONTENT_LENGTH': '81',
- 'CONTENT_TYPE': 'application/json; charset=UTF-8',
- 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
- 'HTTP_CACHE_CONTROL': 'no-cache',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=c025854d94dcb2e5a9e2102fc4b0e208; csrftoken=YGvzneuTfIGFmS7UfPEilltKwJHpi1Wn',
- 'HTTP_HOST': '10.87.177.58',
- 'HTTP_PRAGMA': 'no-cache',
- 'HTTP_REFERER': 'http://10.87.177.58/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'HTTP_X_SCHEME': 'http',
- 'PATH_INFO': u'/inv/inv/554b037ad71f0b10cf9a2391/plugin/rack/rackload/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'POST',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '10.87.177.58',
- 'SERVER_PORT': '80',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x2dda1e0>,
- 'wsgi.input': <_io.BytesIO object at 0x6fcc0b0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- app_logger = <logging.Logger object at 0x58f06d0>
- InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- v = <functools.partial object at 0x58f2470>
- nq = <function nq at 0x6ff3050>
- app = <noc.inv.apps.inv.views.InvApplication object at 0x586e9d0>
- ct = 'application/json; charset=UTF-8'
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement