Code Monkey home page Code Monkey logo

Comments (7)

emilkrueper avatar emilkrueper commented on July 29, 2024

@rvojcik , can you imagine where this is coming from? I started over with your last commit and the error is the same.

from rt-server-client.

unipanic avatar unipanic commented on July 29, 2024

I'm having this same issue, but at Installation Date:

Traceback (most recent call last):
File "./system-info.py", line 500, in
result = rtobject.GetAttributeValue(object_id, rtobject.GetAttributeId("Installation Date"))
File "./lib/rtapi/init.py", line 259, in GetAttributeValue
sql = "SELECT string_value,uint_value,float_value FROM AttributeValue WHERE object_id = %d AND attr_id = %d" % (object_id, attr_id)
TypeError: %d format: a number is required, not NoneType

from rt-server-client.

rvojcik avatar rvojcik commented on July 29, 2024

Hi guys, I have to create some installation script. I merge code from our production to opensource and sometimes there is fields I use in production but you dont have them in racktables.
There is 2 possible solutions.

  1. Comment out the lines where inserting missing attribute
  2. Create attribute in racktables and assign it to server. For these errors you have to create new Server attribute "Installation Date" and "CPU Model" in racktables cofiguration menu

I hope this helps. In new release a create installation script which checks all missing attributes.

from rt-server-client.

rvojcik avatar rvojcik commented on July 29, 2024

Configuration -> Attributes -> (Edit Attributes | Edit Map)

from rt-server-client.

emilkrueper avatar emilkrueper commented on July 29, 2024

Hello @rvojcik and thank you for helping out. I added these two attributes in the racktables and now I receive this error instead.

/opt/rt-server-client# ./system-info.py 
Traceback (most recent call last):
  File "./system-info.py", line 399, in <module>
    rtobject.InsertAttribute(object_id,server_type_id,rtobject.GetAttributeId("CPU Model"),cpu_model_name,"NULL",hostname)
  File "./lib/rtapi/__init__.py", line 242, in InsertAttribute
    self.db_insert(sql)
  File "./lib/rtapi/__init__.py", line 67, in db_insert
    self.dbresult.execute(sql)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`racktables_db`.`AttributeValue`, CONSTRAINT `AttributeValue-FK-map` FOREIGN KEY (`object_tid`, `attr_id`) REFERENCES `AttributeMap` (`objtype_id`, `attr_id`))')

from rt-server-client.

rvojcik avatar rvojcik commented on July 29, 2024

Perfect, you need add all these attributes

  • "CPU Model"
  • "CPUs Logical"
  • "CPUs"
  • "Cores per CPU"
  • "CPU, MHz"
  • "RAM Mem, MB"
  • "Installation Date"
  • "Kernel"

from rt-server-client.

emilkrueper avatar emilkrueper commented on July 29, 2024

I added those attributes as you advised as well, the error is the same, though.

from rt-server-client.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.