From moritz.lenz at noris.de Fri Jan 11 10:20:50 2013 From: moritz.lenz at noris.de (Moritz Lenz) Date: Fri, 11 Jan 2013 10:20:50 +0100 Subject: Parsing responses from the syncupdates-API Message-ID: <50EFD972.7090600@noris.de> Hi all, for my current work I occasionally patch the Net::Whois::Object Perl module (http://search.cpan.org/perldoc?Net%3A%3AWhois%3A%3AObject) which supports talking to the RIPE syncupdates API. Now I'm facing the challenge of parsing the response when creating an object. For example when creating a new handle, the response used to include something along the lines of *** Info: Authorisation for [TS34027-RIPE] from which I could easily extract the handle (which I don't know in advance, because the request I sent contained AUTO-1 as the handle). Now the response doesn't include that information anymore, and instead I get Create SUCCEEDED: [person] TS34027-RIPE Thomas Schoeller from which I don't know how to extract the new handle. I've considered simply using the first word after the [person] block (as regex, \[.*?\]\s+(\S+) or something similar), but that won't work for an inetnum, where the primary key contains spaces. Is there any robust approach on how to extract the primary key from the response? (If person records are the only ones where the primary key is generated from the database, I can special-case that, but it still feels rather fragile). Cheers, Moritz P.S. I should add that so far, I've been pretty amazed by the quality of responses on this mailing list, and from RIPE in general. Thanks everybody, and keep up the good work! From moritz.lenz at noris.de Fri Jan 11 15:56:41 2013 From: moritz.lenz at noris.de (Moritz Lenz) Date: Fri, 11 Jan 2013 15:56:41 +0100 Subject: Error: There is no parent object while creating inetnum Message-ID: <50F02829.9010301@noris.de> Hi, I'm having trouble generating some assignments: Error while creating object through syncupdates API: - From-Host: 62.128.1.62 - Date/Time: Fri Jan 11 15:36:54 2013 SUMMARY OF UPDATE: Number of objects found: 1 Number of objects processed successfully: 0 Create: 0 Modify: 0 Delete: 0 No Operation: 0 Number of objects processed with errors: 1 Create: 1 Modify: 0 Delete: 0 Syntax Errors: 0 DETAILED EXPLANATION: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following object(s) were found to have ERRORS: --- Create FAILED: [inetnum] 62.128.31.128 - 62.128.31.131 ***Error: Authorisation failed ***Info: Syntax check passed inetnum: 62.128.31.128 - 62.128.31.131 netname: testblubb2 country: DE descr: noris network AG admin-c: ML1-TEST tech-c: ML1-TEST status: ASSIGNED PA notify: guardian at noris.net mnt-by: NORIS-MNT source: TEST changed: moritz.lenz at noris.de ***Warning: Date '20130111' added to changed: attribute 'moritz.lenz at noris.de' ***Error: There is no parent object ***Info: Authorisation for [inetnum] 62.128.31.128 - 62.128.31.131 using mnt-by: authenticated by: NORIS-MNT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The RIPE Database is subject to Terms and Conditions: http://www.ripe.net/db/support/db-terms-conditions.pdf For assistance or clarification please contact: RIPE Database Administration Generated by RIPE WHOIS Update version 1.50.2 on WHOIS2 Handled sync update (TEST, LGC, 2013-01-11 15:36:54) at /home/mlenz/src/kunde/kunde/add/kunde_ipaddr line 339 I'm kinda guessing that the 'parent object' that the error message talks about is meant to be the allocation -- but that exists: $ whois -h whois-test.ripe.net 62.128.31.128 % This is the RIPE Database query service. % The objects are in RPSL format. % % The RIPE Database is subject to Terms and Conditions. % See http://www.ripe.net/db/support/db-terms-conditions.pdf % Information related to '62.128.0.0 - 62.128.31.255' inetnum: 62.128.0.0 - 62.128.31.255 netname: DE-NORIS-990421 descr: noris network AG org: ORG-TT1-TEST country: DE admin-c: ML98-TEST tech-c: ML98-TEST status: ALLOCATED PA mnt-by: TEST-NCC-HM-MNT mnt-lower: NORIS-MNT mnt-routes: NORIS-MNT source: TEST changed: nobody at example.com 20130111 and has the correct mnt-lowerk afaict. So, what's the problem here? Cheers, Moritz From kranjbar at ripe.net Fri Jan 11 16:36:55 2013 From: kranjbar at ripe.net (Kaveh Ranjbar) Date: Fri, 11 Jan 2013 16:36:55 +0100 Subject: [dbint] Parsing responses from the syncupdates-API In-Reply-To: <50EFD972.7090600@noris.de> References: <50EFD972.7090600@noris.de> Message-ID: <120CB1A9-7611-4427-8BF5-841E33144300@ripe.net> Hi Moritz, I am sure there are other list members who can provide solutions to this, but from RIPE Database behaviour point of view only creation of "person", "role" and "organisation" objects support use of auto-generated primary keys(*). For creation of other object types and modification or deletion of all objects types, the primary key should be explicitly provided. Hope that helps. Kind Regards, Kaveh. (*)- It is also the case for creation of key-cert objects, only if the object contains an X.509 key. In that case, the "key-cert:" value is auto generated. --- Kaveh Ranjbar, RIPE NCC Database Group Manager On Jan 11, 2013, at 10:20 AM, Moritz Lenz wrote: > Hi all, > > for my current work I occasionally patch the Net::Whois::Object Perl module (http://search.cpan.org/perldoc?Net%3A%3AWhois%3A%3AObject) which supports talking to the RIPE syncupdates API. > > Now I'm facing the challenge of parsing the response when creating an object. For example when creating a new handle, the response used to include something along the lines of > > *** Info: Authorisation for [TS34027-RIPE] > > from which I could easily extract the handle (which I don't know in advance, because the request I sent contained AUTO-1 as the handle). > > Now the response doesn't include that information anymore, and instead I get > > Create SUCCEEDED: [person] TS34027-RIPE Thomas Schoeller > > from which I don't know how to extract the new handle. > > I've considered simply using the first word after the [person] block (as regex, \[.*?\]\s+(\S+) or something similar), but that won't work for an inetnum, where the primary key contains spaces. > > Is there any robust approach on how to extract the primary key from the response? > > (If person records are the only ones where the primary key is generated from the database, I can special-case that, but it still feels rather fragile). > > Cheers, > Moritz > > P.S. I should add that so far, I've been pretty amazed by the quality of responses on this mailing list, and from RIPE in general. Thanks everybody, and keep up the good work! > > From kranjbar at ripe.net Fri Jan 11 16:41:41 2013 From: kranjbar at ripe.net (Kaveh Ranjbar) Date: Fri, 11 Jan 2013 16:41:41 +0100 Subject: Error: There is no parent object while creating inetnum In-Reply-To: <50F02829.9010301@noris.de> References: <50F02829.9010301@noris.de> Message-ID: Hi Moritz, Thanks for letting us know. It seems latest nightly initialisation of test database didn't populate the in-memory object tree properly which had caused this issue for your update. It should be all fine now. For specific issues with RIPE Database, you can always directly contact RIPE NCC's customer services department (ripe-dbm at ripe.net) which is a ticketized email address. Kind Regards, Kaveh. --- Kaveh Ranjbar, RIPE NCC Database Group Manager On Jan 11, 2013, at 3:56 PM, Moritz Lenz wrote: > Hi, > > I'm having trouble generating some assignments: > > Error while creating object through syncupdates API: - From-Host: 62.128.1.62 > - Date/Time: Fri Jan 11 15:36:54 2013 > > > > SUMMARY OF UPDATE: > > Number of objects found: 1 > Number of objects processed successfully: 0 > Create: 0 > Modify: 0 > Delete: 0 > No Operation: 0 > Number of objects processed with errors: 1 > Create: 1 > Modify: 0 > Delete: 0 > Syntax Errors: 0 > > > DETAILED EXPLANATION: > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > The following object(s) were found to have ERRORS: > > > --- > Create FAILED: [inetnum] 62.128.31.128 - 62.128.31.131 > ***Error: Authorisation failed > ***Info: Syntax check passed > > inetnum: 62.128.31.128 - 62.128.31.131 > netname: testblubb2 > country: DE > descr: noris network AG > admin-c: ML1-TEST > tech-c: ML1-TEST > status: ASSIGNED PA > notify: guardian at noris.net > mnt-by: NORIS-MNT > source: TEST > changed: moritz.lenz at noris.de > ***Warning: Date '20130111' added to changed: attribute 'moritz.lenz at noris.de' > > > ***Error: There is no parent object > > > ***Info: Authorisation for [inetnum] 62.128.31.128 - 62.128.31.131 > using mnt-by: > authenticated by: NORIS-MNT > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > The RIPE Database is subject to Terms and Conditions: > http://www.ripe.net/db/support/db-terms-conditions.pdf > > > For assistance or clarification please contact: > RIPE Database Administration > > > > Generated by RIPE WHOIS Update version 1.50.2 on WHOIS2 > Handled sync update (TEST, LGC, 2013-01-11 15:36:54) > at /home/mlenz/src/kunde/kunde/add/kunde_ipaddr line 339 > > > I'm kinda guessing that the 'parent object' that the error message talks about is meant to be the allocation -- but that exists: > > $ whois -h whois-test.ripe.net 62.128.31.128 > % This is the RIPE Database query service. > % The objects are in RPSL format. > % > % The RIPE Database is subject to Terms and Conditions. > % See http://www.ripe.net/db/support/db-terms-conditions.pdf > > % Information related to '62.128.0.0 - 62.128.31.255' > > inetnum: 62.128.0.0 - 62.128.31.255 > netname: DE-NORIS-990421 > descr: noris network AG > org: ORG-TT1-TEST > country: DE > admin-c: ML98-TEST > tech-c: ML98-TEST > status: ALLOCATED PA > mnt-by: TEST-NCC-HM-MNT > mnt-lower: NORIS-MNT > mnt-routes: NORIS-MNT > source: TEST > changed: nobody at example.com 20130111 > > and has the correct mnt-lowerk afaict. > > So, what's the problem here? > > Cheers, > Moritz > From moritz.lenz at noris.de Mon Jan 14 09:51:14 2013 From: moritz.lenz at noris.de (Moritz Lenz) Date: Mon, 14 Jan 2013 09:51:14 +0100 Subject: Error: There is no parent object while creating inetnum In-Reply-To: References: <50F02829.9010301@noris.de> Message-ID: <50F3C702.5080606@noris.de> Hi Kaveh, On 01/11/2013 04:41 PM, Kaveh Ranjbar wrote: > Thanks for letting us know. It seems latest nightly initialisation of test database didn't populate the in-memory object tree properly which had caused this issue for your update. > It should be all fine now. Thanks for your help, it seems all is fine now indeed. > For specific issues with RIPE Database, you can always directly contact RIPE NCC's customer services department (ripe-dbm at ripe.net) which is a ticketized email address. My problem is that I'm still rather new to the RIPE DB, and usually can't tell if the error is mine or not. But if I suspect that the database is to blame, I'll contact the address you mention. Cheers, Moritz