'Jenkins giving Type Error: String indices must be integer

I am using robot framework for API testing, the tests are passing in local but failing in jenkins with the error TypeError: String indices must be integers.

Validate Response while ignoring keys
[Arguments]         ${service_details}
${resp}=            Set Variable        ${service_details}[response]
Should Be True      ${resp.status_code} == ${service_details}[expected_status]
${resp_content}=    Sanitize JSON       ${resp.text}
Log                 ${service_details}[expected_response]
Log                 ${resp_content}
Validate Response Contains Expected Response    ${resp_content}    ${service_details}[expected_response]   ${service_details}[ignored_keys]
...                                             ${service_details}[full_list_validation]  ${service_details}[identity_key]

It is failing with this error on the last Validate call, any idea what is going wrong in jenkins?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source