[Bug 887188] New: zypper cache dir cannot be changed; does not honor "-C" or any settings via "--config"
https://bugzilla.novell.com/show_bug.cgi?id=887188 https://bugzilla.novell.com/show_bug.cgi?id=887188#c0 Summary: zypper cache dir cannot be changed; does not honor "-C" or any settings via "--config" Classification: openSUSE Product: openSUSE 11.4 Version: Final Platform: x86-64 OS/Version: openSUSE 11.1 Status: NEW Severity: Major Priority: P5 - None Component: libzypp AssignedTo: zypp-maintainers@forge.provo.novell.com ReportedBy: richard.steenwyk@ge.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- Created an attachment (id=598527) --> (http://bugzilla.novell.com/attachment.cgi?id=598527) Template for defining local working directory as a repository User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 Using zypper1.3.7 on SLES11.1 'cachedir' hierarchy is explained well in /etc/zypp/zypp.conf and changing the setting there works as expected. I desire to set the cache directory to something other than /var/cache/zypp/... for execution as a non-root user, meaning that modifying /etc/zypp/zypp.conf is not an option Bugs: 1. "-C" command line option has no effect a. Similarly, "--raw-cache-dir" has no effect either 2. Adding "cachedir" setting to "~/.zypper.conf" has no effect 3. Authoring own "zypp.conf" and supplying via "--config" has no effect Config file access was confirmed with strace as increasing logging verbosity (2+) doesn't produce any additional diagnostic messages Reproducible: Always Steps to Reproduce: 1. Create a repo in a local directory with "createrepo ." 2. Using attached template file, define the local directory as a(n empty) repository 3. Run "zypper -C . lr" 4. Observe that zypper knows about the local file-based (empty) repository 5. Run "zypper -D . search something" 6. Observe failure with root cause: "Can't provide /repodata/repomd.xml : Can't create /repodata" indicating that path to cache directory isn't accessible 7. Run "zypper -D . -C . search something" 8. Observe same failure with root cause: "Can't provide /repodata/repomd.xml : Can't create /repodata" indicating that path to cache directory isn't accessible, except "-C" option should've provided it 9. Copy system config file "/etc/zypp/zypp.conf" to local directory, edit to specify "cachedir = <local working directory>" 10. Run "zypper -D . -c zypp.conf search something" 11. Observe same failure with root cause: "Can't provide /repodata/repomd.xml : Can't create /repodata" indicating that path to cache directory isn't accessible, except "-c" option should've supplied config file containing this setting 12. Run "zypper -D . -C . --raw-cache-dir . search something" 13. Observe similar failure with root cause: "Error building the cache: 'repo2solv.sh' '-o' '/var/cache/zypp/solv/EmptyLocal/solv' './EmptyLocal' /usr/bin/repo2solv.sh: line 67: /var/cache/zypp/solv/EmptyLocal/solv: No such file or directory Problem loading data from 'EmptyLocal' Resolvables from 'EmptyLocal' not loaded because of error." indicating that path to cache directory isn't accessible, except "-C" and "--raw-cache-dir" options should've provided it 14. Edit system config "/etc/zypp/zypp.conf" to specify "cachedir = <local working directory>" 15. Run "zypper -D . --no-gpg-checks search something" 16. Observe success in building (empty) repository cache, confirmed by creation of "raw" and "solv" cache directory hierarchies in the local working directory and no errors reported by zypper Actual Results: Inlined with "Steps to Reproduce" Note that all invocations of zypper during these steps will have a return code of zero; one must examine the (limited) error messages to see the problem Expected Results: The cache directory hierarchy should've been rooted using the value supplied through any one of the three means described above. Increasing output verbosity adds some additional context. From one example ("zypper -D . -C . --no-gpg-checks -vvvv se something"): Verbosity: 4 Entering 'no-gpg-checks' mode. Non-option program arguments: 'something' Initializing Target Repository 'EmptyLocal' is out-of-date. You can run 'zypper refresh' as root to update it. Loading repository data... Retrieving repository 'EmptyLocal' data... Checking whether to refresh metadata for EmptyLocal Retrieving repository 'EmptyLocal' metadata [error] Repository 'EmptyLocal' is invalid. History: - Can't create /repodata - Can't provide /repodata/repomd.xml : Can't create /repodata - [|] Valid metadata not found at specified URL(s) Please check if the URIs defined for this repository are pointing to a valid repository. Problem loading data from 'EmptyLocal' Resolvables from 'EmptyLocal' not loaded because of error. Reading installed packages... Force resolution: No No packages found. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=887188 https://bugzilla.novell.com/show_bug.cgi?id=887188#c1 Rich Steenwyk <richard.steenwyk@ge.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P2 - High --- Comment #1 from Rich Steenwyk <richard.steenwyk@ge.com> 2014-07-14 21:56:42 UTC --- Note that product in use was SLES11.1; bug system didn't have any choices less than 11.4 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=887188 https://bugzilla.novell.com/show_bug.cgi?id=887188#c2 Michael Andres <ma@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #2 from Michael Andres <ma@suse.com> 2014-07-15 13:43:14 CEST ---
Bugs: 1. "-C" command line option has no effect a. Similarly, "--raw-cache-dir" has no effect either
Yes, this was fixed in zypper-1.4.4. Zypper mistook the way the underlying libzypp organizes it's chache dirs. That's why the options are not usable for your purpose on SLE11.1. '-C,--cache-dir' fails to redirect the complete cache tree. '--raw-cache-dir' (copy of the original repo metada) works, but it does not help you because repo2solv.sh will parse these data and create a .solv-file cache for fast access in (/var/cache/zypp)/solv. A --solv-cache-dir option to redirect this directory as well is missing.
2. Adding "cachedir" setting to "~/.zypper.conf" has no effect 3. Authoring own "zypp.conf" and supplying via "--config" has no effect
That's right. zypper, YaST, PackageKit all use a common package management library (libzypp) and it's options (e.g. the cache dirs) are kept in zypp.conf. zyppers --config option affects only it's own config file (zypper.conf), and this file is not meant to override the common zypp.conf options. _____WORKAROUND: SLE11.1 is out of maintenance, so I can't offer an official zypper fix for this, but: - libzypp itself supports redirecting it's "zypp.conf" via an environment variable: export ZYPP_CONF="<location (absolute path!) of your private zypp.conf>" zypper .... - I fixed at least the zypper source code to redirect the whole cache tree with -C. The patch is availabe at 'https://github.com/openSUSE/zypper/commit/cd73b1256e23ade8efdfcf499337863d27...'. (SuSE-Code-11_2-Branch is the branch for SLE11-SP1). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com