Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 662760

Summary: Failed repo sync still shows success
Product: [Retired] Pulp Reporter: Jay Dobies <jason.dobies>
Component: z_otherAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: jmatthew
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: 2011-08-16 14:02:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 647488    

Description Jay Dobies 2010-12-13 19:41:53 UTC
For whatever reason, the /var/lib/pulp/packages directory on my box got changed to be owned by root. That meant that pulp (grinder) couldn't write the package bits to that directory, but it was able to save the repo metadata. I saw this in the output:

[root@guardian ~]# pulp-admin repo sync --id pulp-testing -F
Sync for repository pulp-testing started
You can safely CTRL+C this current command and it will continue
[                                                  ] 0% (10 of 10 pkgs)
Sync: Finished


So it looks like it was successful but in reality it wasn't. It's an odd scenario as I've listed it, but I wonder if we'd see the same behavior if they ran out of disk space while downloading the packages. We should indicate that sort of thing was a sync error to the caller.

Example package download error message from grinder:

2010-12-13 14:35:43,622 [INFO][Thread-13] fetch() @ BaseFetch.py:89 - Creating directory: /var/lib/pulp/packages/a76/python-pymongo/1.6/5.fc14/x86_64
2010-12-13 14:35:43,622 [CRITICAL][Thread-13] fetch() @ BaseFetch.py:98 - [Errno 13] Permission denied: '/var/lib/pulp/packages/a76'

Comment 1 John Matthews 2011-01-04 15:02:23 UTC
Not able to reproduce this bug, I think it's been fixed already. Moving to MODIFIED so it can be retested in next build.

$ sudo chmod 500 /var/lib/pulp/packages/

$ sudo pulp-admin -u admin -p admin repo sync --id jwmb -F
Sync for repository jwmb started
You can safely CTRL+C this current command and it will continue
[                                                     ] 0%
Sync: Error
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 7, in <module>
    execfile(__file__)
  File "/shared/repo/pulp/bin/pulp-admin", line 147, in <module>
    admin.main()
  File "/shared/repo/pulp/src/pulp/client/cli/base.py", line 98, in main
    command.main(args[1:])
  File "/shared/repo/pulp/src/pulp/client/core/base.py", line 118, in main
    action.main(args[1:])
  File "/shared/repo/pulp/src/pulp/client/core/base.py", line 229, in main
    self.run()
  File "/shared/repo/pulp/src/pulp/client/core/repo.py", line 530, in run
    self.sync_foreground(task)
  File "/shared/repo/pulp/src/pulp/client/core/repo.py", line 502, in sync_foreground
    raise SyncError(task['traceback'][-1])
pulp.client.core.repo.SyncError: OSError: [Errno 13] Permission denied: '/var/lib/pulp/packages/3f8'

Comment 2 Jay Dobies 2011-01-05 19:45:20 UTC
Fixed in 0.120.

Comment 3 Preethi Thomas 2011-01-06 16:56:04 UTC
Looks like this is fails_qa
[root@pulp-f13 ~]# rpm -q pulp
pulp-0.0.121-1.fc13.noarch


[root@pulp-f13 ~]# ls -l /var/lib/pulp/packages/
total 40
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 032
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 060
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 1ad
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 24c
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 2e4
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 571
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 76d
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 c85
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 cfd
drwxr-sr-x. 3 apache apache 4096 Jan  6 11:18 d89
[root@pulp-f13 ~]# rm -rf /var/lib/pulp/packages/
[root@pulp-f13 ~]# mkdir /var/lib/pulp/packages/
[root@pulp-f13 ~]# ls -l /var/lib/pulp/packages/
total 0
[root@pulp-f13 ~]# chmod 500 /var/lib/pulp/packages/
[root@pulp-f13 ~]# pulp-admin repo create --id=pulp-repo1 --name=pulp-repo1 --feed=yum:http://repos.fedorapeople.org/repos/pulp/pulp/testing/fedora-14/x86_64/
Successfully created repository [ pulp-repo1 ]

[root@pulp-f13 ~]# pulp-admin repo sync --id=pulp-repo1 -F
Sync for repository pulp-repo1 started
You can safely CTRL+C this current command and it will continue
[                                                  ] 0% (10 of 10 pkgs)
Sync: Finished

[root@pulp-f13 ~]# ls -l /var/lib/pulp/packages/total 0
[root@pulp-f13 ~]#

Comment 4 John Matthews 2011-01-06 23:12:05 UTC
Issue is with "yum" syncs.  "local" syncs are working OK.

For yum syncs we weren't communicating errors from grinder to pulp.

Comment 5 John Matthews 2011-01-06 23:39:49 UTC
Change was to add the number of errors/successes from grinder to the Progress Callback.  

Pulp CLI will look at the progress report at the end of a sync.  If errors occurred it will notify the user that %d errors occurred.

Below is an example with 10 errors:

$ sudo pulp-admin -u admin -p admin repo sync --id pulp-repo1 -F
Sync for repository pulp-repo1 started
You can safely CTRL+C this current command and it will continue
[==================================================] 100% (10 of 10 pkgs)
Sync: Finished
Warning: 10 errors occurred


Pulp Commit here:
http://git.fedorahosted.org/git/?p=pulp.git;a=commit;h=86eafb12050ceb0f7fbbe2b679346d7b8f57996c


Grinder Commit here:
http://git.fedorahosted.org/git/?p=grinder.git;a=commit;h=5cf6366bf8ac0b887aca8a91e3aa1b7c249c0bbc

Comment 6 Jay Dobies 2011-01-07 19:21:57 UTC
Fixed in build 0.122.

Comment 7 Preethi Thomas 2011-01-10 15:07:16 UTC
[root@preethi ~]# rpm -q pulp
pulp-0.0.122-1.fc14.noarch

[root@preethi ~]# rm -rf /var/lib/pulp/packages/
[root@preethi ~]# 
[root@preethi ~]#  mkdir /var/lib/pulp/packages/
[root@preethi ~]# ls -l /var/lib/pulp/packages/
total 0
[root@preethi ~]# chmod 500 /var/lib/pulp/packages/
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin repo create --id=f14 --name=f14 --feed=yum:http://download.devel.redhat.com/released/F-14/GOLD/Fedora/x86_64/os/
Successfully created repository [ f14 ]



[root@preethi ~]# pulp-admin repo sync --id=f14 -F
Sync for repository f14 started
You can safely CTRL+C this current command and it will continue
[                                                  ] 0% (15 of 2773 pkgs)
Sync: Finished
Warning: 15 errors occurred

Comment 8 Preethi Thomas 2011-08-16 14:02:18 UTC
Closing with Community Release 15

pulp-0.0.223-4.