Bug 796169

Summary: Deleting a repository with name having space displays exception
Product: [Other] RHQ Project Reporter: Sunil Kondkar <skondkar>
Component: ContentAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 4.3CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
StackTrace none

Description Sunil Kondkar 2012-02-22 12:28:58 UTC
Description of problem:

Deleting a repository with name having space displays exception.

It displays below in UI:

Failed to delete repositories. Cause: javax.ejb.EJBTransactionRolledbackException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> javax.persistence.EntityExistsException:org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update -> org.hibernate.exception.ConstraintViolationException:Could not execute JDBC batch update -> java.sql.BatchUpdateException:Batch entry 0 delete from RHQ_REPO where ID='10075' was aborted. Call getNextException to see the cause.[SQLException=Batch entry 0 delete from RHQ_REPO where ID='10075' was aborted. Call getNextException to see the cause. -> ERROR: update or delete on table "rhq_repo" violates foreign key constraint "rhq_repo_repo_relation_map_repo_id_fkey" on table "rhq_repo_repo_relation_map" Detail: Key (id)=(10075) is still referenced from table "rhq_repo_repo_relation_map".(error-code=0,sql-state=23503)]

The stack trace in server log is attached.


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

Build Version: JON 3.0.1.GA RC5 (Build Number: dd8a001:fbca611)
Browser: Firefox 3.6.3
Database : PostgreSQL 8.3.8

How reproducible:

Always

Steps to Reproduce:

1.Create directory structure at platform as below:

mkdir /sunil2
cd /sunil2
mkdir testfolder
cd testfolder
mkdir "repo sunil"
Place a WAR file in folder "repo sunil"

2. Login to UI
3. Navigate to Administration->Content->Content Sources
4. Click on 'Create New' button.
5. Click on 'Local Disk Storage Content Source'.
6. Enter below details:

Name: sunil2
Download Mode: Never
Root Directory: /sunil2
Package Type Name: JBossAS5 - Web Application (WAR) - WAR File
Architecture Name: noarch
Resource Type: JBossAS5 - Web Application (WAR)
Repo Source Enabled : yes


7. After creating the content source, it displays  repositories with name 'testfolder' and 'repo sunil' in Candidate Repositories section.
8. Import 'repo sunil' repository. It displays  repository with name 'repo sunil' in Repositories section.
9. Click on the repository with name 'repo sunil'.
10.Click on the 'Syncronize' button in the UI for repository.
11.It displays the WAR file in 'Packages' section of the repository.

12. Navigate to Administration->Content->Repositories
13. Select the repository with name 'test folder'.
14. Click on 'Delete Selected' button.
  
Actual results:

Repository is not deleted and it displays exception in UI and server log.

Expected results:

It should delete the repository.

Additional info:

Comment 1 Sunil Kondkar 2012-02-22 12:30:08 UTC
Created attachment 564937 [details]
StackTrace

Comment 3 Mike Foley 2012-02-22 15:30:30 UTC
triage 2/12/2012 ccrouch, stefan_n, mfoley