Hide Forgot
Description of problem: API::ImagesController#destroy and API::TargetImagesController#destroy returns 500 error when there is no image/target_image found but API::ProviderImagesController#destroy and API::BuildsController#destroy returns 404 error when there is no provider_image/build found. Version-Release number of selected component (if applicable): rpm -qa | grep aeolus aeolus-conductor-daemons-0.9.0-0.20120118181603git71cd8bc.fc16.noarch aeolus-conductor-0.9.0-0.20120118181603git71cd8bc.fc16.noarch rubygem-aeolus-cli-0.4.0-0.20120118121626git6fddd65.fc16.noarch aeolus-configure-2.6.0-0.20120118121620gita996371.fc16.noarch aeolus-all-0.9.0-0.20120118181603git71cd8bc.fc16.noarch aeolus-conductor-doc-0.9.0-0.20120118181603git71cd8bc.fc16.noarch rubygem-aeolus-image-0.4.0-0.20120201113104git920ad8a.fc16.noarch How reproducible: Steps to Reproduce: 1. curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/images/1234.xml 2. curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/target_images/1234.xml 3. curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/provider_images/1234.xml 4. curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/builds/1234.xml 5. compare results Actual results: for Image: ... < HTTP/1.1 500 Internal Server Error ... <error> <code>ImageDeleteFailure</code> <message>Could not find Image 1234</message> </error> for TargetImage: ... < HTTP/1.1 500 Internal Server Error ... <error> <code>TargetImageDeleteFailure</code> <message>Could not find TargetImage 1234</message> </error> for ProviderImage: ... < HTTP/1.1 404 Not Found ... <error> <code>ProviderImageNotFound</code> <message>Could not find ProviderImage 1234</message> </error> for Build: ... < HTTP/1.1 404 Not Found ... <error> <code>BuildNotFound</code> <message>Could not find Build 1234</message> </error> Expected results: All the same type of error - 404 Not Found All the same kind of error code and message in body - "_Entity_NotFound" and "Could not find _Entity_ _ID_" Additional info: Should be corrected by adding missing rescue and reraising 404 error in destroy method of ImagesController and TargetImagesController as it is already implemented on destroy method of ProviderImagesController and BuildsController.
Posted here: https://fedorahosted.org/pipermail/aeolus-devel/2012-February/008541.html
commit 87b172ad20bd17746f7c795ced05ddc42987b9d2 Author: Petr Blaho <pblaho> Date: Wed Feb 1 14:31:32 2012 +0100 BZ786452 Correct inconsistency in returning errors at API controllers Changes returning error from 500 to 404 of API::ImagesController#destroy when looked up Image does not exist This mimics behaviour and code in API::ProviderImagesController#destroy and API::BuildsController#destroy. The same correction for API::TargetImagesController#destroy method.
87b172a in aeolus-conductor-0.8.0-19
========================== Image ================================== curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/images/1234.xml * About to connect() to localhost port 443 (#0) * Trying ::1... connected * Connected to localhost (::1) port 443 (#0) * Initializing NSS with certpath: /etc/pki/nssdb * warning: ignoring value of ssl.verifyhost * skipping SSL peer certificate verification * SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA * Server certificate: * subject: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * start date: Feb 01 02:40:35 2012 GMT * expire date: Jan 31 02:40:35 2013 GMT * common name: qe-blade-06.idm.lab.bos.redhat.com * issuer: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * Server auth using Basic with user 'admin' > DELETE /conductor/api/images/1234.xml HTTP/1.1 > Authorization: Basic YWRtaW46cGFzc3dvcmQ= > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.9.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > Host: localhost > Accept: application/xml > < HTTP/1.1 404 Not Found < Date: Fri, 03 Feb 2012 13:03:54 GMT < Server: thin 1.2.11 codename Bat-Shit Crazy < Cache-Control: no-cache < Content-Type: application/xml; charset=utf-8 < X-Runtime: 0.061281 < X-UA-Compatible: IE=Edge,chrome=1 < Set-Cookie: _session_id=BAh7CCIPc2Vzc2lvbl9pZCIlZmM4ZjQ3NmNlNzIwOTg4OTJjOTRjNTE3NTZhMmYzZDciGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--cd52b8a5d2c4de203ff510325b9983ea3f8f9342; path=/; HttpOnly < Connection: close < Transfer-Encoding: chunked < <error> <code>ImageNotFound</code> <message>Could not find Image 1234</message> </error> * Closing connection #0 ===================== Target Image ============================================= curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/target_images/1234.xml * About to connect() to localhost port 443 (#0) * Trying ::1... connected * Connected to localhost (::1) port 443 (#0) * Initializing NSS with certpath: /etc/pki/nssdb * warning: ignoring value of ssl.verifyhost * skipping SSL peer certificate verification * SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA * Server certificate: * subject: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * start date: Feb 01 02:40:35 2012 GMT * expire date: Jan 31 02:40:35 2013 GMT * common name: qe-blade-06.idm.lab.bos.redhat.com * issuer: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * Server auth using Basic with user 'admin' > DELETE /conductor/api/target_images/1234.xml HTTP/1.1 > Authorization: Basic YWRtaW46cGFzc3dvcmQ= > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.9.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > Host: localhost > Accept: application/xml > < HTTP/1.1 404 Not Found < Date: Fri, 03 Feb 2012 13:05:53 GMT < Server: thin 1.2.11 codename Bat-Shit Crazy < Cache-Control: no-cache < Content-Type: application/xml; charset=utf-8 < X-Runtime: 0.043625 < X-UA-Compatible: IE=Edge,chrome=1 < Set-Cookie: _session_id=BAh7CCIPc2Vzc2lvbl9pZCIlMzQ2NjIyZmNmNjE0NTRkMGE3YzkzYjI3ODlmOGFjMzciGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--fe14e9bec975528b9a1ef6c5e29927d67220f42c; path=/; HttpOnly < Connection: close < Transfer-Encoding: chunked < <error> <code>TargetImageNotFound</code> <message>Could not find TargetImage 1234</message> </error> * Closing connection #0 ===========================Provider Image ================================== curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/provider_images/1234.xml * About to connect() to localhost port 443 (#0) * Trying ::1... connected * Connected to localhost (::1) port 443 (#0) * Initializing NSS with certpath: /etc/pki/nssdb * warning: ignoring value of ssl.verifyhost * skipping SSL peer certificate verification * SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA * Server certificate: * subject: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * start date: Feb 01 02:40:35 2012 GMT * expire date: Jan 31 02:40:35 2013 GMT * common name: qe-blade-06.idm.lab.bos.redhat.com * issuer: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * Server auth using Basic with user 'admin' > DELETE /conductor/api/provider_images/1234.xml HTTP/1.1 > Authorization: Basic YWRtaW46cGFzc3dvcmQ= > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.9.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > Host: localhost > Accept: application/xml > < HTTP/1.1 404 Not Found < Date: Fri, 03 Feb 2012 13:09:00 GMT < Server: thin 1.2.11 codename Bat-Shit Crazy < Cache-Control: no-cache < Content-Type: application/xml; charset=utf-8 < X-Runtime: 0.043792 < X-UA-Compatible: IE=Edge,chrome=1 < Set-Cookie: _session_id=BAh7CCIPc2Vzc2lvbl9pZCIlYzNiNjk3ZTFjOWU2ZTMzMWE4MmRiMmJlM2Y5NWRhNjAiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--2948b61d6e63b4a58e1a3dee17d562a32e7248d2; path=/; HttpOnly < Connection: close < Transfer-Encoding: chunked < <error> <code>ProviderImageNotFound</code> <message>Could not find ProviderImage 1234</message> </error> * Closing connection #0 =============================Build======================================= curl -vk -XDELETE -uadmin:password --header "Accept: application/xml" https://localhost/conductor/api/builds/1234.xml * About to connect() to localhost port 443 (#0) * Trying ::1... connected * Connected to localhost (::1) port 443 (#0) * Initializing NSS with certpath: /etc/pki/nssdb * warning: ignoring value of ssl.verifyhost * skipping SSL peer certificate verification * SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA * Server certificate: * subject: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * start date: Feb 01 02:40:35 2012 GMT * expire date: Jan 31 02:40:35 2013 GMT * common name: qe-blade-06.idm.lab.bos.redhat.com * issuer: E=root.lab.bos.redhat.com,CN=qe-blade-06.idm.lab.bos.redhat.com,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=-- * Server auth using Basic with user 'admin' > DELETE /conductor/api/builds/1234.xml HTTP/1.1 > Authorization: Basic YWRtaW46cGFzc3dvcmQ= > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.9.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > Host: localhost > Accept: application/xml > < HTTP/1.1 404 Not Found < Date: Fri, 03 Feb 2012 13:10:33 GMT < Server: thin 1.2.11 codename Bat-Shit Crazy < Cache-Control: no-cache < Content-Type: application/xml; charset=utf-8 < X-Runtime: 0.041116 < X-UA-Compatible: IE=Edge,chrome=1 < Set-Cookie: _session_id=BAh7CCIPc2Vzc2lvbl9pZCIlZDliNGY0MDM5ZTk3YjdiNzYxNTQxZTdkYTM2NTY5MTUiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--4d440b1ff25954962fef0b111bfe3816bcea747e; path=/; HttpOnly < Connection: close < Transfer-Encoding: chunked < <error> <code>BuildNotFound</code> <message>Could not find Build 1234</message> </error> * Closing connection #0 ====================================================== All show 404 ============================== rpm -qa|grep aeolus aeolus-conductor-doc-0.8.0-19.el6.noarch aeolus-configure-2.5.0-11.el6.noarch aeolus-all-0.8.0-19.el6.noarch aeolus-conductor-0.8.0-19.el6.noarch rubygem-aeolus-image-0.3.0-7.el6.noarch rubygem-aeolus-cli-0.3.0-7.el6.noarch aeolus-conductor-daemons-0.8.0-19.el6.noarch