cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
641
Views
1
Helpful
4
Replies

Unable to rename device template using sql

stephan.steiner
Spotlight
Spotlight

Because AXL is completely FUBAR'd when it comes to managing templates, I have to create my phone templates by creating regular phones, then changing the type using sql, then changing the name. Except, of course that doesn't work for whatever reason. Oh yeah, it works in ccmadmin, and once changed in ccmadmin, I can then go nuts changing the name again using SQL through AXL. Except that doesn't get me anywhere.

Here are the logs:

2017-10-26 15:13:22,807 DEBUG [http-bio-443-exec-216] wrappers.RequestNamespaceWrapper - Inside Request Wrapper

2017-10-26 15:13:22,816 DEBUG [http-bio-443-exec-216] servletRouters.AXLAlpha - AXL REQUEST :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5"><soapenv:Header/><soapenv:Body><ns:executeSQLUpdate sequence="0"> <sql>update device set name = &apos;Template BOT&apos; where name = &apos;BOT044567122756&apos;</sql></ns:executeSQLUpdate></soapenv:Body></soapenv:Envelope>

2017-10-26 15:13:22,816 DEBUG [http-bio-443-exec-216] servletRouters.AXLAlpha - Request processed by AXIS

2017-10-26 15:13:22,818 DEBUG [http-bio-443-exec-216] axlapiservice.Handler - dbConnector Initialization in handler.java

2017-10-26 15:13:22,819 DEBUG [http-bio-443-exec-216] axlapiservice.Axl - Connection given to current thread

2017-10-26 15:13:22,819 DEBUG [http-bio-443-exec-216] axlapiservice.AXLCallFlow - In begin transaction of AXLCallflow and created pub connector

2017-10-26 15:13:22,819 DEBUG [http-bio-443-exec-216] axlapiservice.AXLAPIServiceSkeleton - In ExecuteSQLQueryResponseDocument

2017-10-26 15:13:22,820 DEBUG [http-bio-443-exec-216] axlapiservice.ExecuteSqlHandler - update device set name = 'Template BOT' where name = 'BOT044567122756'

2017-10-26 15:13:22,820 DEBUG [http-bio-443-exec-216] axlapiservice.ExecuteSqlHandler - sqlQuery:update device set name='template bot' where name='bot044567122756'

2017-10-26 15:13:22,820 DEBUG [http-bio-443-exec-216] axlapiservice.ExecuteSqlHandler - userRankTable:

2017-10-26 15:13:22,862 WARN  [http-bio-443-exec-216] axlapiservice.ExecuteSqlHandler - java.sql.SQLException: 491

2017-10-26 15:13:22,862 ERROR [http-bio-443-exec-216] axlapiservice.AXLAPIServiceSkeleton - SQL EXCEPTION has occurred, will be sending you the exact error Info

2017-10-26 15:13:22,862 DEBUG [http-bio-443-exec-216] axlapiservice.AXLCallFlow - In rollback transaction and created pub connector

2017-10-26 15:13:22,863 DEBUG [http-bio-443-exec-216] axlapiservice.Axl - Connection closed and hashmap entry removed in AXL.java closing connection

2017-10-26 15:13:22,863 DEBUG [http-bio-443-exec-216] axlapiservice.AXLCallFlow - Rollback transaction connector object closed

2017-10-26 15:13:22,863 DEBUG [http-bio-443-exec-216] axlapiservice.AXLCallFlow - In AXL CAll Flow class, method getSOAPError

2017-10-26 15:13:22,863 DEBUG [http-bio-443-exec-216] axlapiservice.AXLCallFlow - checking typeDBErrors for sql exception name

2017-10-26 15:13:22,864 DEBUG [http-bio-443-exec-216] axlapiservice.AXLCallFlow - Setting soap fault

2017-10-26 15:13:22,864 DEBUG [http-bio-443-exec-216] axlapiservice.AXLCallFlow - Setting soap fault2

2017-10-26 15:13:22,867 DEBUG [http-bio-443-exec-216] servletRouters.AXLAlpha - <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>The specified name has invalid characters or is not formatted correctly for this device type.Valid characters include [a-zA-Z0-9._-]{1,50}</faultstring><detail><axlError><axlcode>491</axlcode><axlmessage>The specified name has invalid characters or is not formatted correctly for this device type.Valid characters include [a-zA-Z0-9._-]{1,50}</axlmessage><request>executeSQLUpdate</request></axlError></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

2017-10-26 15:13:22,867 DEBUG [http-bio-443-exec-216] servletRouters.AXLAlpha - Finished processing request

2017-10-26 15:13:22,868 INFO  [http-bio-443-exec-216] filters.TimingFilter - Request 1505911707181 received from sdkuser at ip 10.80.0.168 was processed in 65ms

4 Replies 4

stephan.steiner
Spotlight
Spotlight

Oh yeah, look at the regex it returns as being valid characters. And here's what you get if you try to work the problem with AXL - basically the same thing.

2017-10-26 15:59:54,487 DEBUG [http-bio-443-exec-182] filters.TimingFilter - Received request 1505911707276 from sdkuser at IP 10.80.0.168

2017-10-26 15:59:54,487 DEBUG [http-bio-443-exec-182] wrappers.RequestHeaderWrapper - Inside Request Header Wrapper

2017-10-26 15:59:54,487 DEBUG [http-bio-443-exec-182] filters.AuthenticationFilter - Operation:update api:updatePhone

2017-10-26 15:59:54,488 DEBUG [http-bio-443-exec-182] filters.ThrottlingFilter - DBLCNQueue Count: 0

2017-10-26 15:59:54,488 DEBUG [http-bio-443-exec-182] filters.ThrottlingFilter - Successfully set the value of counter: 4 value: 0

2017-10-26 15:59:54,488 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - Checking request version [11.5]

2017-10-26 15:59:54,488 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - Checking if requested api [updatePhone] the implementedHandlers list

2017-10-26 15:59:54,488 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - [updatePhone] is not in the implementedHandlers list

2017-10-26 15:59:54,489 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - Checking if version is 8.x

2017-10-26 15:59:54,489 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - function to check if the version is 8.x

2017-10-26 15:59:54,489 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - version is not 8.x

2017-10-26 15:59:54,489 INFO  [http-bio-443-exec-182] servletRouters.AXLAlpha - Executing api: updatePhone in axis

2017-10-26 15:59:54,489 DEBUG [http-bio-443-exec-182] wrappers.RequestNamespaceWrapper - Inside Request Wrapper

2017-10-26 15:59:54,499 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - AXL REQUEST :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5"><soapenv:Header/><soapenv:Body><ns:updatePhone sequence="0"> <uuid>{45463B96-F98E-8EA6-5E5C-6FEF3B7FDD4D}</uuid><newName>Template BOT</newName></ns:updatePhone></soapenv:Body></soapenv:Envelope>

2017-10-26 15:59:54,499 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - Request processed by AXIS

2017-10-26 15:59:54,502 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - dbConnector Initialization in handler.java

2017-10-26 15:59:54,502 DEBUG [http-bio-443-exec-182] axlapiservice.Axl - Connection given to current thread

2017-10-26 15:59:54,503 DEBUG [http-bio-443-exec-182] axlapiservice.AXLCallFlow - In begin transaction of AXLCallflow and created pub connector

2017-10-26 15:59:54,505 DEBUG [http-bio-443-exec-182] axlapiservice.UpdatePhoneHandler - select isdualmode, tkProduct,tkdeviceprotocol,tkmodel,tkclass,mtpRequired from device where pkid='45463b96-f98e-8ea6-5e5c-6fef3b7fdd4d'

2017-10-26 15:59:54,506 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - select tksupportsfeature, tkdeviceprotocol,param from ProductSupportsFeature where tkproduct='462'  and tkdeviceprotocol in ('11',99)

2017-10-26 15:59:54,507 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 116

2017-10-26 15:59:54,508 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 supports feature 21

2017-10-26 15:59:54,508 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 34

2017-10-26 15:59:54,508 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 35

2017-10-26 15:59:54,508 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 supports feature 18

2017-10-26 15:59:54,509 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 79

2017-10-26 15:59:54,509 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 78

2017-10-26 15:59:54,509 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 53

2017-10-26 15:59:54,509 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 120

2017-10-26 15:59:54,510 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 supports feature 114

2017-10-26 15:59:54,510 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 supports feature 114

2017-10-26 15:59:54,510 DEBUG [http-bio-443-exec-182] axlapiservice.UpdatePhoneHandler - Select tkcertificateoperation from device where pkid = '45463b96-f98e-8ea6-5e5c-6fef3b7fdd4d'

2017-10-26 15:59:54,511 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 supports feature 72

2017-10-26 15:59:54,511 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 supports feature 76

2017-10-26 15:59:54,511 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 77

2017-10-26 15:59:54,512 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 does not support feature 63

2017-10-26 15:59:54,512 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - Product 462 supports feature 104

2017-10-26 15:59:54,512 DEBUG [http-bio-443-exec-182] axlapiservice.Handler - update device set Name='Template BOT' where pkid='45463b96-f98e-8ea6-5e5c-6fef3b7fdd4d'

2017-10-26 15:59:54,541 ERROR [http-bio-443-exec-182] axlapiservice.AXLAPIServiceSkeleton - SQL EXCEPTION has occurred, will be sending you the exact error Info

2017-10-26 15:59:54,542 DEBUG [http-bio-443-exec-182] axlapiservice.AXLCallFlow - In rollback transaction and created pub connector

2017-10-26 15:59:54,542 DEBUG [http-bio-443-exec-182] axlapiservice.Axl - Connection closed and hashmap entry removed in AXL.java closing connection

2017-10-26 15:59:54,542 DEBUG [http-bio-443-exec-182] axlapiservice.AXLCallFlow - Rollback transaction connector object closed

2017-10-26 15:59:54,542 DEBUG [http-bio-443-exec-182] axlapiservice.AXLCallFlow - In AXL CAll Flow class, method getSOAPError

2017-10-26 15:59:54,543 DEBUG [http-bio-443-exec-182] axlapiservice.AXLCallFlow - checking typeDBErrors for sql exception name

2017-10-26 15:59:54,543 DEBUG [http-bio-443-exec-182] axlapiservice.AXLCallFlow - Setting soap fault

2017-10-26 15:59:54,543 DEBUG [http-bio-443-exec-182] axlapiservice.AXLCallFlow - Setting soap fault2

2017-10-26 15:59:54,547 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>The specified name has invalid characters or is not formatted correctly for this device type.Valid characters include [a-zA-Z0-9._-]{1,50}</faultstring><detail><axlError><axlcode>491</axlcode><axlmessage>The specified name has invalid characters or is not formatted correctly for this device type.Valid characters include [a-zA-Z0-9._-]{1,50}</axlmessage><request>updatePhone</request></axlError></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

2017-10-26 15:59:54,547 DEBUG [http-bio-443-exec-182] servletRouters.AXLAlpha - Finished processing request

2017-10-26 15:59:54,547 INFO  [http-bio-443-exec-182] filters.TimingFilter - Request 1505911707276 received from sdkuser at ip 10.80.0.168 was processed in 60ms

It looks like you're putting a space in the name of the new device - "Template BOT" is that right? Have you tried it without a space in the name (e.g. BOTTEMPLATE)?

Yes, it's a space in there. Removing it would make it work since it satisfies the regex. However, this being a phone template, spaces in the name are allowed, so it performs an incorrect validation.

Ok - thanks for the confirmation. Your post made it sound like it wasn't working at all. Definitely an issue with the validation.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: