Bug 692638 - No User readable error displayed on console while import invalid Owner.
Summary: No User readable error displayed on console while import invalid Owner.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Bryan Kearney
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-31 18:47 UTC by spandey
Modified: 2015-05-14 16:04 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-20 18:50:38 UTC


Attachments (Terms of Use)

Description spandey 2011-03-31 18:47:48 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
10/10

Prerequisites
Candlepin A ,Candlepin B (on-premises)

Steps to repro  :
import Invalid Owner from Candlepin A .
Import Owner from invalid Candlepin (not candlepin ip).

Expected Result : 
At step 1 
Proper Error message should display on console for invalid Owner.
At step 2
Proper  Error message should display invalid Candlepin URL 

Actual Result : 
Migration started no error msg displayed on console.

[root@candlepin1 ~]# curl -k -u admin:admin -X POST "https://10.65.193.123:8443/candlepin/migrations?entity=owner&id=101010101001010101010101&uri=10.65.193.174:8080"
{"id":"migrate_owner_9cbfb240-a8f8-4de6-bbf6-427b727706ad","state":"CREATED","result":null,"startTime":null,"finishTime":null,"statusPath":"/jobs/migrate_owner_9cbfb240-a8f8-4de6-bbf6-427b727706ad","updated":"2011-03-31T18:30:21.031+0000","created":"2011-03-31T18:30:21.031+0000"}[root@candlepin1 ~]# 

[root@candlepin1 ~]# curl -k -u admin:admin -X POST "https://10.65.193.123:8443/candlepin/migrations?entity=owner&id=101010101001010101010101&uri=10.65.193.74:8080"
{"id":"migrate_owner_581914a7-909d-4ef1-96fa-2e780eb4fcaf","state":"CREATED","result":null,"startTime":null,"finishTime":null,"statusPath":"/jobs/migrate_owner_581914a7-909d-4ef1-96fa-2e780eb4fcaf","updated":"2011-03-31T18:31:09.068+0000","created":"2011-03-31T18:31:09.068+0000"}[root@candlepin1 ~]#

Comment 1 Devan Goodwin 2011-12-20 18:20:47 UTC
Not sure this is worth fixing, we would have to start communicating with the remote candlepin, outside the context of the asynchronous job, so we could report the error before starting the job, rather than the details on the job we're kicking off. 

To me this is working as I would expect, kick off the job, check it's status later and see if anything went wrong.

(dgoodwin@rhel6 ~/src) $ curl -k -u admin:admin -X POST "https://localhost:8443/candlepin/migrations?entity=owner&id=IDONTEXIST&uri=192.168.1.25:8080"

{"id":"migrate_owner_c782fc19-944d-4424-b42e-96fb3da14910","state":"CREATED","result":null,"targetType":null,"startTime":null,"group":"async group","principalName":"admin","targetId":null,"finishTime":null,"statusPath":"/jobs/migrate_owner_c782fc19-944d-4424-b42e-96fb3da14910","updated":"2011-12-20T18:18:36.095+0000","created":"2011-12-20T18:18:36.095+0000"}%

(dgoodwin@rhel6 ~/src) $ curl -k -u admin:admin "http://localhost:8080/candlepin/jobs/migrate_owner_c782fc19-944d-4424-b42e-96fb3da14910"

{"id":"migrate_owner_c782fc19-944d-4424-b42e-96fb3da14910","state":"FAILED","result":"org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.candlepin.exceptions.NotFoundException: Can't find owner [IDONTEXIST]]","targetType":null,"startTime":"2011-12-20T18:18:36.112+0000","group":"async group","principalName":"admin","targetId":null,"finishTime":null,"statusPath":"/jobs/migrate_owner_c782fc19-944d-4424-b42e-96fb3da14910","updated":"2011-12-20T18:18:36.194+0000","created":"2011-12-20T18:18:36.095+0000"}%                                                               

Anyone else have thoughts?

Comment 2 Jesus M. Rodriguez 2011-12-20 18:31:27 UTC
+1 to working as designed. We could add throwing JobExecutionException code to the execute method of the job, to update the cp_jobs table with a status.
But beyond that we are NOT giving errors to the console.

The PinsetterJobListener will take the value from the context and exception message and update the job as failed.

Comment 3 Devan Goodwin 2011-12-20 18:50:38 UTC
Going to close for now.


Note You need to log in before you can comment on or make changes to this bug.