Send Netdot-users mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-users
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-users digest..."


Today's Topics:

   1. Re: REST POST issues (Boyer, Eric)
   2. Re: REST POST issues (Carlos Vicente)


----------------------------------------------------------------------

Message: 1
Date: Tue, 26 Aug 2014 19:45:27 +0000
From: "Boyer, Eric" <[email protected]>
Subject: Re: [Netdot-users] REST POST issues
To: Netdot-users <[email protected]>
Cc: Carlos Vicente <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="windows-1252"

Hello,

We found the issue but it turns out that it had nothing to do with my script.

One of our users had entered in a new host (A/PTR, DHCP records) via the web 
user interface. However, he had also added a location record (LOC record). 
Apparently, having a location record assigned to a DNS entity breaks the Netdot 
exporter scripts for the entire zone file that the host is in. Apparently this 
script places a lock on each of the database tables as it exports.

This seems like it is a bug in the Netdot code that the developers should look 
into.

Thanks,

-------------
Eric Boyer
Network Engineer
National Center for Supercomputing Applications


On Aug 22, 2014, at 8:50 PM, Boyer, Eric 
<[email protected]<mailto:[email protected]>> wrote:

Hi guys,

I am currently experiencing a strange issue. I have a script that does a POST 
request to the /rest/host interface to create a host with a DNS name and DHCP 
allocation. I am currently using a python library that someone on the netdot 
team made a while ago ( I?ve needed to modify slightly due to errors in their 
code). That library is https://github.com/frgray/netdot-client-python.

So now to the issue. This script has worked well for months. Today, however, it 
has decided to stop working. I did not make any changes to the netdot 
configuration or my script. I turned on the debug mode and am getting a 400 bad 
request error, as seen at the bottom of this email. I can see that the script 
successfully authenticates to the page. I checked logs and also saw the below 
log entries. Any ideas? Thanks in advance.

LOGS
RR RR destroyed without saving changes to modified at 
/usr/local/netdot/htdocs/rest/host line 318
netdot netdot: INFO - /rest/host: POST request with args:  from 141.142.143.160 
(python-requests/2.3.0 CPython/2.7.8 FreeBSD/10.0-RELEASE-p7)


SCRIPT DEBUG OUTPUT
_content :  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.22 (Debian) Server at Port 443</address>
</body></html>

headers :  CaseInsensitiveDict({'content-length': '249', 'content-encoding': 
'gzip', 'vary': 'Accept-Encoding', 'server': 'Apache/2.2.22 (Debian)', 
'connection': 'close', 'date': 'Sat, 23 Aug 2014 01:24:55 GMT', 'content-type': 
'text/html; charset=iso-8859-1'})
status_code :  400
_content_consumed :  True
encoding :  iso-8859-1
request :  <PreparedRequest [POST]>
connection :  <requests.adapters.HTTPAdapter object at 0x809b59150>
elapsed :  0:00:51.082378
raw :  <requests.packages.urllib3.response.HTTPResponse object at 0x809b6ccd0>
reason :  Bad Request
history :  []
Traceback (most recent call last):
  File "./activate_button.py", line 103, in <module>
    r = dot.create_host(host)
  File 
"/services/www/netact.ncsa.illinois.edu/data/cgi-bin/netdot_client_python/netdot/Client.py<http://netact.ncsa.illinois.edu/data/cgi-bin/netdot_client_python/netdot/Client.py>",
 line 451, in create_host
    return self.post("/host", data)
  File 
"/services/www/netact.ncsa.illinois.edu/data/cgi-bin/netdot_client_python/netdot/Client.py<http://netact.ncsa.illinois.edu/data/cgi-bin/netdot_client_python/netdot/Client.py>",
 line 158, in post
    response.raise_for_status()
  File 
"/usr/local/lib/python2.7/site-packages/requests-2.3.0-py2.7.egg/requests/models.py",
 line 793, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request

-------------
Eric Boyer
Network Engineer
National Center for Supercomputing Applications



-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://osl.uoregon.edu/pipermail/netdot-users/attachments/20140826/65a247d8/attachment-0001.html
 

------------------------------

Message: 2
Date: Tue, 26 Aug 2014 15:54:07 -0400
From: Carlos Vicente <[email protected]>
Subject: Re: [Netdot-users] REST POST issues
To: "Boyer, Eric" <[email protected]>
Cc: Netdot-users <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

Can you be more specific on how it breaks? Any error messages, logs, etc?

cv

On Aug 26, 2014, at 3:45 PM, Boyer, Eric <[email protected]> wrote:

> Apparently, having a location record assigned to a DNS entity breaks the 
> Netdot exporter scripts for the entire zone file that the host is in




------------------------------

_______________________________________________
Netdot-users mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-users


End of Netdot-users Digest, Vol 69, Issue 10
********************************************

Reply via email to