Getting error while exporting the device list DCIM

49 views
Skip to first unread message

santhosh khanna

unread,
Jan 4, 2021, 5:31:16 AM1/4/21
to NetBox
 Server Error

There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

<class 'AttributeError'>
'Device' object has no attribute 'model' Python version: 3.6.8 NetBox version: 2.9.9

If further assistance is required, please post to the NetBox mailing list.

Brian Candler

unread,
Jan 4, 2021, 11:32:48 AM1/4/21
to NetBox
Can you be more specific about exactly what you did that triggers the error?  Did you go to `/dcim/devices/` and then click on the Export button?  Were you using an export template that you had written, or the default?  If using an export template, please show the contents of that template.

Finally, can you generate a backtrace? In configuration.py, either set DEBUG=True, or set ADMINS and EMAIL (in the latter case, the backtrace will be e-mailed to you automatically whenever Netbox generates an exception)

santhosh khanna

unread,
Jan 25, 2021, 12:20:56 PM1/25/21
to NetBox
Hi Brian,

Thanks for your response, I didn't create any export template. I'm using the default template.

In config.py, the DEBUG has been set as false.


# Set to True to enable server debugging. WARNING: Debugging introduces a substantial performance penalty and may reveal
# sensitive information about your installation. Only enable debugging while performing testing. Never enable debugging
# on a production system.
DEBUG = False

# Email settings
EMAIL = {
    'SERVER': 'localhost',
    'PORT': 25,
    'USERNAME': '',
    'PASSWORD': '',
    'USE_SSL': False,
    'USE_TLS': False,
    'TIMEOUT': 10,  # seconds
    'FROM_EMAIL': '',
}

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/3fafee5d-5354-4de3-980e-4f56e255b3f2n%40googlegroups.com.

Brian Candler

unread,
Jan 25, 2021, 12:51:07 PM1/25/21
to NetBox
Device export with default templates works for me (Netbox 2.10.3)

If you want the backtrace to be E-mailed to you, then you have to set the "ADMINS" list to include at least one E-mail address.  With your given EMAIL config, you also need to make sure you are running a local MTA (e.g. postfix, exim etc) and it is listening on port 25, at least on localhost interface - you can test this with "telnet localhost 25" and see if you get an SMTP banner.

Otherwise, set DEBUG = True temporarily, restart, reproduce the problem, capture the backtrace, and then you can put it back again.

Alternatively, you can temporarily run a debug server listening on a different port, see 
...but first remember to active the virtualenv:
source /opt/netbox/venv/bin/activate
cd /opt/netbox/netbox
python3 manage.py runserver 0.0.0.0:8000 --insecure


then point web browser at http://x.x.x.x:8000/

santhosh khanna

unread,
Jan 25, 2021, 1:22:10 PM1/25/21
to NetBox
hi brian,

After doing the debug, found the issue and closed it. It helped a lot. thanks


Brian Candler

unread,
Jan 25, 2021, 1:35:23 PM1/25/21
to NetBox
Would you mind sharing with the group what the problem was, and the solution?

santhosh khanna

unread,
Jan 25, 2021, 1:54:38 PM1/25/21
to NetBox

Hi Brian,

This was due to editing the values manually at the devices.py. after debug found the exceptional line and removed it.

Brian Candler

unread,
Jan 26, 2021, 6:16:02 AM1/26/21
to NetBox
OK.  You're not supposed to modify Netbox source; if you do, you are running your own private fork and you shouldn't expect any help.

Custom fields mean that you shouldn't need to touch the data model; Netbox 2.10 makes them much easier to use.  Netbox also provides facilities for custom scripts, reports, and plugins that you can add (in their own directories, without touching Netbox source), and webhooks.

Reply all
Reply to author
Forward
0 new messages