Modify Resource API HTTP/1.1 500 Internal Server Error

Version 1
    This document was generated from CDN thread

    Created by: Tom Tajic on 19-07-2013 06:59:00 AM
    I would like to modify the skills, which belong to the user  (Resource) "ASI-agent3".

    First of all, there is a BUG in the documentation which states wrong URI for resource modification
    http://<server>/adminapi/resources/{id} should be http://<server>/adminapi/resource/{id}

    I get HTTP/1.1 500 Internal Server Error, with no explanaition at all. Everything seems OK to me. Please help.

    REQUEST 

    PUT https://192.168.245.167/adminapi/resource/ASI-agent3
    HTTP/1.1
    Content-Type: application/xml
    Authorization: Basic
    YXZ0ZW50YW5ldDphdnRlbnRhLm5ldA==
    Host: 192.168.245.167
    Content-Length: 793
    Expect: 100-
    continueConnection: Keep-Alive
    <?xml version="1.0" encoding="UTF-8"?><resource><userID>ASI-agent3</userID><firstName>mojca</firstName><lastName>agent</lastName><extension>10001000</extension><resourceGroup name="ASI-Vsi"><refURL>https://192.168.245.167/adminapi/resourceGroup/3</refURL></resourceGroup><skillMap><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="Pridobivanje Terminov"><refURL>https://192.168.245.167/adminapi/Skill/5</refURL></skillNameUriPair></skillCompetency></skillMap><autoAvailable>true</autoAvailable><type>2</type><team name="Default"><refURL>https://192.168.245.167/adminapi/team/1</refURL></team><secondarySupervisorOf><supervisorOfTeamName name="Default"><refURL>https://192.168.245.167/adminapi/team/1</refURL></supervisorOfTeamName></secondarySupervisorOf></resource>

    RESPONSE

    HTTP/1.1 500 Internal Server ErrorSet-Cookie: JSESSIONID=AA8BD7FAFDA8D158FB0D8F610F436A25; Path=/adminapi/; Secure; HttpOnlyContent-Type: application/xmlContent-Length: 156Date: Fri, 19 Jul 2013 11:51:10 GMTConnection: closeServer: Cisco
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiErrors><apiError><errorData>ServerError</errorData><errorType></errorType></apiError></apiErrors>

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Praveen Sinha on 22-07-2013 09:37:48 AM
    Tom Tajic:
    I would like to modify the skills, which belong to the user  (Resource) "ASI-agent3".

    First of all, there is a BUG in the documentation which states wrong URI for resource modification
    http://<server>/adminapi/resources/{id} should be http://<server>/adminapi/resource/{id}

    I get HTTP/1.1 500 Internal Server Error, with no explanaition at all. Everything seems OK to me. Please help.

    REQUEST 

    PUT https://192.168.245.167/adminapi/resource/ASI-agent3
    HTTP/1.1
    Content-Type: application/xml
    Authorization: Basic
    YXZ0ZW50YW5ldDphdnRlbnRhLm5ldA==
    Host: 192.168.245.167
    Content-Length: 793
    Expect: 100-
    continueConnection: Keep-Alive
    <?xml version="1.0" encoding="UTF-8"?><resource><userID>ASI-agent3</userID><firstName>mojca</firstName><lastName>agent</lastName><extension>10001000</extension><resourceGroup name="ASI-Vsi"><refURL>https://192.168.245.167/adminapi/resourceGroup/3</refURL></resourceGroup><skillMap><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="Pridobivanje Terminov"><refURL>https://192.168.245.167/adminapi/Skill/5</refURL></skillNameUriPair></skillCompetency></skillMap><autoAvailable>true</autoAvailable><type>2</type><team name="Default"><refURL>https://192.168.245.167/adminapi/team/1</refURL></team><secondarySupervisorOf><supervisorOfTeamName name="Default"><refURL>https://192.168.245.167/adminapi/team/1</refURL></supervisorOfTeamName></secondarySupervisorOf></resource>

    RESPONSE

    HTTP/1.1 500 Internal Server ErrorSet-Cookie: JSESSIONID=AA8BD7FAFDA8D158FB0D8F610F436A25; Path=/adminapi/; Secure; HttpOnlyContent-Type: application/xmlContent-Length: 156Date: Fri, 19 Jul 2013 11:51:10 GMTConnection: closeServer: Cisco
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiErrors><apiError><errorData>ServerError</errorData><errorType></errorType></apiError></apiErrors>
    Hi Tom,

    I don't see any problem with the xml structure and the service is behaving corectly in our test beds. To zero in on the problem you can check if the skill and the resource group specified by you exists and both the name and href parts are ok. You can try changing the same from appadmin and the doing a rest GET on it and compare to zero in on the issue with the posted xml.
    As a last resort you can collect the ccx logs and lookout for the error in the MADM logs. That can give you more idea on why you are getting internal server error.

    If you are not able to resolve please share the MADM logs and server version details.

    Thanks and Regards,
    Praveen

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Tom Tajic on 01-08-2013 02:25:26 AM
    Hello!

    I've checked the message data and it seems ok.

    Please check the MADS error logs if you can spot a possible cause (I could not):

    I am providing two links for master/slave logs. (Master is 192.168.245.167)

    The time of the REST API request is 15:58.

    https://dl.dropboxusercontent.com/u/19087106/as-ipcc1.asworkgroup_CiscoUnifiedCCXAdministration_MADM_2013-07-31_16-15-56.zip

    https://dl.dropboxusercontent.com/u/19087106/as-ipcc2.asworkgroup_CiscoUnifiedCCXAdministration_MADM_2013-07-31_16-15-49.zip

    Thanks and Regards,
    Tom

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Praveen Sinha on 13-08-2013 01:49:04 AM
    Hi Tom,

    First of all apologies for the delay. There is nothing in the logs which can suggest of any issue. We might need to try out a dioganistic patch. For that as stated earlier, I would need uccx version details (including the ES level and any other patch applied on the box). Also, please do let me know if the dioganistic patch to figure out the issue will work for you.

    Thanks and Regards,
    Praveen

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Tom Tajic on 14-08-2013 12:19:18 PM
    System version: 9.0.2.10000-71
    No patches installed.

    Regards, tom

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Praveen Sinha on 16-08-2013 06:12:01 AM
    Hi Tom,

    Looks like there is a bug in the 902 version, which is fixed in our dev branch. I will be working with the team here to see if we can include this patch in the next SU/ES release on 902, I will update you with the timeline shortly.

    In the meanwhile you can try one of these work arounds
    1. Using app admin from the team page, you can remove this user from the secondary supervisor of default team
    2. You can make a dummy team and add this user as a primary supervisor of that team.

    Thanks and Regards,
    Praveen

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Tom Tajic on 19-08-2013 09:44:44 AM
    Hello!

    I've tried what you suggested: 

    1. Using app admin from the team page, I have removed the user from the secondary supervisor of default team
    2. I made a dummy team "DummyTeam" and added this user as a primary supervisor of that team.

    I've executed the PUT request and I get the same error.

    REQUEST:
    PUT https://192.168.245.167/adminapi/resource/ASI-agent3
    HTTP/1.1Content-Type: application/xmlAuthorization: Basic YXZ0ZW50YW5ldDphdnRlbnRhLm5ldA==Host: 192.168.245.167Content-Length: 775Expect: 100-continueConnection: Keep-Alive
    <?xml version="1.0" encoding="UTF-8"?><resource><userID>ASI-agent3</userID><firstName>mojca</firstName><lastName>agent</lastName><extension>10001000</extension><resourceGroup name="ASI-Vsi"><refURL>https://192.168.245.167/adminapi/resourceGroup/3</refURL></resourceGroup><skillMap><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="COS"><refURL>https://192.168.245.167/adminapi/Skill/15</refURL></skillNameUriPair></skillCompetency></skillMap><autoAvailable>true</autoAvailable><type>2</type><team name="Default"><refURL>https://192.168.245.167/adminapi/team/1</refURL></team><primarySupervisorOf><supervisorOfTeamName name="DummyTeam"><refURL>https://192.168.245.167/adminapi/team/15</refURL></supervisorOfTeamName></primarySupervisorOf></resource>


    Response:
    HTTP/1.1 500 Internal Server ErrorSet-Cookie: JSESSIONID=7B970FE484A6D10B20423378BF62FB97; Path=/adminapi/; Secure; HttpOnlyContent-Type: application/xmlContent-Length: 156Date: Mon, 19 Aug 2013 14:43:40 GMTConnection: closeServer: Cisco
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiErrors><apiError><errorData>ServerError</errorData><errorType></errorType></apiError></apiErrors>

    Subject: Re: New Message from Tom Tajic in Contact Center Express Configuration API
    Replied by: Praveen Sinha on 19-08-2013 10:42:31 AM
    Hi Tom,

    Did you use both the options together, l had suggested you to use one of those.

    Please confirm.

    Thanks and regards,
    Praveen


    Sent from Samsung Mobile



    -------- Original message --------
    From: Cisco Developer Community Forums <cdicuser@developer.cisco.com>
    Date:
    To: cdicuser@developer.cisco.com
    Subject: New Message from Tom Tajic in Contact Center Express Configuration API (UCCXAPI) - Message Boards Home - Contact Center Express Configuration API (UCCXAPI): RE: Modify Resource API HTTP/1.1 500 Internal Server Error


    Tom Tajic has created a new message in the forum "Message Boards Home - Contact Center Express Configuration API (UCCXAPI)": -------------------------------------------------------------- Hello!

    I've tried what you suggested:

    1. Using app admin from the team page, I have removed the user from the secondary supervisor of default team
    2. I made a dummy team "DummyTeam" and added this user as a primary supervisor of that team.

    I've executed the PUT request and I get the same error.

    REQUEST:
    PUT https://192.168.245.167/adminapi/resource/ASI-agent3
    HTTP/1.1Content-Type: application/xmlAuthorization: Basic YXZ0ZW50YW5ldDphdnRlbnRhLm5ldA==Host: 192.168.245.167Content-Length: 775Expect: 100-continueConnection: Keep-Alive
    <?xml version="1.0" encoding="UTF-8"?><resource><userID>ASI-agent3</userID><firstName>mojca</firstName><lastName>agent</lastName><extension>10001000</extension><resourceGroup name="ASI-Vsi"><refURL>https://192.168.245.167/adminapi/resourceGroup/3</refURL></resourceGroup><skillMap><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="COS"><refURL>https://192.168.245.167/adminapi/Skill/15</refURL></skillNameUriPair></skillCompetency></skillMap><autoAvailable>true</autoAvailable><type>2</type><team name="Default"><refURL>https://192.168.245.167/adminapi/team/1</refURL></team><primarySupervisorOf><supervisorOfTeamName name="DummyTeam"><refURL>https://192.168.245.167/adminapi/team/15</refURL></supervisorOfTeamName></primarySupervisorOf></resource>


    Response:
    HTTP/1.1 500 Internal Server ErrorSet-Cookie: JSESSIONID=7B970FE484A6D10B20423378BF62FB97; Path=/adminapi/; Secure; HttpOnlyContent-Type: application/xmlContent-Length: 156Date: Mon, 19 Aug 2013 14:43:40 GMTConnection: closeServer: Cisco
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><apiErrors><apiError><errorData>ServerError</errorData><errorType></errorType></apiError></apiErrors>
    --
    To respond to this post, please click the following link: http://developer.cisco.com/web/uccxapi/community/-/message_boards/view_message/18380983 or simply reply to this email.

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Tom Tajic on 23-08-2013 09:01:31 AM
    Hello!

    I've found the problems causing the server error:
    BUG1:  When you GET the resource via REST API, you get skillCompetency like show below 
    <skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="COS"><refURL>https://192.168.245.167/adminapi/Skill/15</refURL></skillNameUriPair></skillCompetency>

    If you make a request to the 
    https://192.168.245.167/adminapi/Skill/15 it fails!
    If you make a request to the 
    https://192.168.245.167/adminapi/skill/15 it succeeds.

    case-sensitive urls- BRAVO!!!

    BUG2: If the user (resource) is defined as a 
    secondary supervisor of default team, you are unable to modify his skills via REST API.

    I hope this information helps someone, so he can spend his hours with his/her family instead.

    Regards,
    Tom

    Subject: RE: Modify Resource API HTTP/1.1 500 Internal Server Error
    Replied by: Praveen Sinha on 20-09-2013 02:13:47 AM
    Hi Tom,

    Both the bugs have been already identified and fixed. Thanks for the help and patience.

    Bug1: Is slated for next maintainance release.

    Bug2: Is fixed and released in 9.0(2) SU1 ES01

    You can find the details here http://ccbu.cisco.com/display/UCCX/Linux+ES+and+Release+Calender.

    Thanks and Regards,
    Praveen