I figured it out!!
pyrpkg has changed... version 1.46 (included in RHEL/CentOS) is not changing CWD...
--- /usr/lib/python2.7/site-packages/pyrpkg/__init__.py.old 2017-01-03
17:00:28.439908995 +0100
+++ /usr/lib/python2.7/site-packages/pyrpkg/__init__.py 2017-01-03 17:00:52.971164701
+0100
@@ -2381,6 +2381,9 @@
replace=replace)
gitignore = GitIgnore(os.path.join(self.path, '.gitignore'))
+ oldpath = os.getcwd()
+ os.chdir(self.path)
+
for f in files:
# TODO: Skip empty file needed?
file_hash = self.lookasidecache.hash_file(f)
fixes it...
now for the next issue... :)
----- Original meddelelse -----
Fra: "praiskup" <praiskup(a)redhat.com>
Til: "copr-devel" <copr-devel(a)lists.fedorahosted.org>
Cc: "mj" <mj(a)casalogic.dk>, "Michal Novotny"
<clime(a)redhat.com>
Sendt: onsdag, 4. januar 2017 11:21:06
Emne: Re: dist-git is failing to import
On Tuesday, January 3, 2017 12:57:30 PM CET Martin Juhl wrote:
Found the following in the copr-dist-git logs...
Seems like the package is unpacked incorrectly??
Any ideas??
There's something like:
with open(filename, 'rb') as f:
IOError: [Errno 2] No such file or directory: 'urllib3-1.10.2.tar.gz'
I would start there ... it looks like the file is not there, or that dist-git
runs the script with unexpected CWD.
Who's behind the copr-dist-git project??
The copr-dist-git package is in copr git repo (under /dist-git/ path).
Pavel
> Regards
>
> Martin
>
> [11:39:30][INFO][dist_git.dist_git_importer][dist_git_importer:484] 2. Task:
34-epel7, importing the package:
http://copr02.casalogic.lan/tmp/tmpKCC9iD/python-urllib3-1.10.2-2.el7_1.s...
> [11:39:30][DEBUG][dist_git.dist_git_importer][dist_git_importer:361] downloading
package
http://copr02.casalogic.lan/tmp/tmpKCC9iD/python-urllib3-1.10.2-2.el7_1.s...
> [11:39:30][DEBUG][dist_git.dist_git_importer][dist_git_importer:428] Verifying
packagage, getting name and version.
> [11:39:30][DEBUG][dist_git.dist_git_importer][dist_git_importer:457] make sure repos
exist: mrmeee/Fisk/python-urllib3
> [11:39:30][DEBUG][dist_git.dist_git_importer][dist_git_importer:415] importing srpm
into the dist-git
> [11:39:30][DEBUG][dist_git.srpm_import][srpm_import:57] repo_dir:
/tmp/tmpSIthaA/python-urllib3
> [11:39:30][DEBUG][dist_git.srpm_import][srpm_import:77] clone the pkg repository into
tmp directory
> [11:39:30][DEBUG][pyrpkg][__init__:1279] Checking out a specific branch
ssh://copr-dist-git@localhost/mrmeee/Fisk/python-urllib3
> [11:39:30][DEBUG][pyrpkg][__init__:952] Running git clone -b epel7
ssh://copr-dist-git@localhost/mrmeee/Fisk/python-urllib3 --origin origin and logging
output
> [11:39:31][INFO][pyrpkg][__init__:973] Cloning into 'python-urllib3'...
>
> [11:39:31][DEBUG][dist_git.srpm_import][srpm_import:79] import the source rpm into
git and save filenames of sources
> [11:39:31][DEBUG][pyrpkg][__init__:680] Creating repo object from
/tmp/tmpSIthaA/python-urllib3
> [11:39:31][DEBUG][pyrpkg][__init__:1105] Running: rpm -qp --nosignature --qf %{NAME}
/tmp/tmpUWrkGm/package.src.rpm
> [11:39:31][DEBUG][pyrpkg][__init__:1120] Running: rpm -qpl
/tmp/tmpUWrkGm/package.src.rpm
> [11:39:31][INFO][dist_git.srpm_import][srpm_import:86] save the source files into
lookaside cache
> [11:39:31][ERROR][dist_git.srpm_import][srpm_import:91] traceback: <function
format_exc at 0x7fedb9ac25f0>
> Traceback (most recent call last):
> File "/usr/share/copr/dist_git/srpm_import.py", line 89, in
actual_do_git_srpm_import
> commands.upload(upload_files, replace=True)
> File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 2386, in
upload
> file_hash = self.lookasidecache.hash_file(f)
> File "/usr/lib/python2.7/site-packages/pyrpkg/lookaside.py", line 100, in
hash_file
with open(filename, 'rb') as f:
IOError: [Errno 2] No such file or directory: 'urllib3-1.10.2.tar.gz'
>
[11:39:31][ERROR][dist_git.srpm_import][srpm_import:92] [Errno 2] No such file or
directory: 'urllib3-1.10.2.tar.gz'
> Traceback (most recent call last):
> File "/usr/share/copr/dist_git/srpm_import.py", line 89, in
actual_do_git_srpm_import
> commands.upload(upload_files, replace=True)
> File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 2386, in
upload
> file_hash = self.lookasidecache.hash_file(f)
> File "/usr/lib/python2.7/site-packages/pyrpkg/lookaside.py", line 100, in
hash_file
with open(filename, 'rb') as f:
IOError: [Errno 2] No such file or directory: 'urllib3-1.10.2.tar.gz'
>
[11:39:31][DEBUG][dist_git.srpm_import][srpm_import:93] git push
> [11:39:31][DEBUG][pyrpkg][__init__:952] Running git commit -m import_srpm -a and
logging output
> [11:39:31][INFO][pyrpkg][__init__:973] # On branch epel7
> # Untracked files:
> # (use "git add <file>..." to include in what will be committed)
> #
> # urllib3-1.10.2.tar.gz
> nothing added to commit but untracked files present (use "git add" to
track)
>
> [11:39:31][ERROR][dist_git.srpm_import][srpm_import:101] error during commit and
push, ignored
> Traceback (most recent call last):
> File "/usr/share/copr/dist_git/srpm_import.py", line 97, in
actual_do_git_srpm_import
> commands.commit(message)
> File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 1429, in
commit
> self._run_command(cmd, cwd=self.path)
> File "/usr/lib/python2.7/site-packages/pyrpkg/__init__.py", line 976, in
_run_command
> % (' '.join(cmd), proc.returncode, error))
> rpkgError: Command git commit -m import_srpm -a returned code 1 with error:
> [11:39:31][DEBUG][dist_git.dist_git_importer][dist_git_importer:452] refreshing cgit
listing
> [11:39:31][DEBUG][dist_git.dist_git_importer][dist_git_importer:496] sending a
response - success
> [11:39:31][DEBUG][dist_git.dist_git_importer][dist_git_importer:465] Sending back:
> {"pkg_version": "1.10.2-2.el7_1", "git_hash":
"25815eedd9db50a1d20c088c14e07da15e316a8c", "pkg_name":
"python-urllib3", "task_id": "34-epel7",
"repo_name": "mrmeee/Fisk/python-urllib3"}
>
>
>
> Fra: "mj" <mj(a)casalogic.dk>
> Til: "Michal Novotny" <clime(a)redhat.com>
> Cc: "copr-devel" <copr-devel(a)lists.fedorahosted.org>
> Sendt: mandag, 2. januar 2017 11:15:13
> Emne: Re: dist-git is failing to import
>
> Hi
>
> Happy new year..
>
> Still stuck here...
>
> Any new ideas???
>
> Regards
>
> Martin
>
> ----- Original meddelelse -----
> Fra: "mj" <mj(a)casalogic.dk>
> Til: "Michal Novotny" <clime(a)redhat.com>
> Sendt: mandag, 5. december 2016 19:14:25
> Emne: Re: dist-git is failing to import
>
> Have traced it a little further...
>
> in /usr/lib/python2.7/site-packages/pyrpkg/__init__.py:
>
> line 2386 (or close by): file_hash = self.lookasidecache.hash_file(f)
>
> Still no real error though...
>
> ----- Original meddelelse -----
> Fra: "Michal Novotny" <clime(a)redhat.com>
> Til: "mj" <mj(a)casalogic.dk>
> Sendt: mandag, 5. december 2016 17:36:31
> Emne: Re: dist-git is failing to import
>
> On Mon, Dec 5, 2016 at 5:30 PM, Martin Juhl < mj(a)casalogic.dk > wrote:
>
>
> I'm not really any good with writing Python.. I can usually read it...
>
> Something like this (just gives the same error message)???
>
> try:
> commands.upload(upload_files, replace=True)
> except Exception:
> log.exception("Failed!!!!")
>
>
>
>
>
> try:
> commands.upload(upload_files, replace=True)
> except Exception as e:
> log.exception("traceback: {0}".format(traceback.format_exc))
> log.exception(str(e))
>
>
> /Martin
>
> ----- Original meddelelse -----
> Fra: "Michal Novotny" < clime(a)redhat.com >
> Til: "mj" < mj(a)casalogic.dk >
> Sendt: mandag, 5. december 2016 17:25:19
> Emne: Re: dist-git is failing to import
>
> On Mon, Dec 5, 2016 at 5:16 PM, Martin Juhl < mj(a)casalogic.dk > wrote:
>
>
> Hi
>
> [root@copr02 new]# rpm -aq |grep pyrpkg
> pyrpkg-1.46-5.el7.noarch - It's from EPEL...
>
> What's your version...
>
> Seems to be here it fails:
>
> log.info ("save the source files into lookaside cache")
> commands.upload(upload_files, replace=True) <------ FAILS
> log.debug("git push")
>
> So is probably the pyrpkg library... what version do you use??
>
>
>
>
>
> The same version and release (packaged for fc23) is on production.
>
> Try to wrap that code into try-except and print traceback an exception message. That
might show us something.
>
>
> /Martin
>
>
>
> ----- Original meddelelse -----
> Fra: "Michal Novotny" < clime(a)redhat.com >
> Til: "copr-devel" < copr-devel(a)lists.fedorahosted.org >
> Sendt: mandag, 5. december 2016 17:05:12
> Emne: Re: dist-git is failing to import
>
> On Mon, Dec 5, 2016 at 4:46 PM, Martin Juhl < mj(a)casalogic.dk > wrote:
>
>
> When trying to import, dist-git is failing:
>
> [15:12:20][DEBUG][dist_git.dist_git_importer][dist_git_importer:392] 1. Try to get
task data
> [15:12:20][INFO][dist_git.dist_git_importer][dist_git_importer:484] 2. Task: 9-epel7,
importing the package:
http://copr02.casalogic.lan/tmp/tmpuxT8L3/copr-mocks-1.5-1.el7.src.rpm
> [15:12:20][DEBUG][dist_git.dist_git_importer][dist_git_importer:361] downloading
package
http://copr02.casalogic.lan/tmp/tmpuxT8L3/copr-mocks-1.5-1.el7.src.rpm
> [15:12:20][DEBUG][dist_git.dist_git_importer][dist_git_importer:428] Verifying
packagage, getting name and version.
> [15:12:20][DEBUG][dist_git.dist_git_importer][dist_git_importer:457] make sure repos
exist: mrmeee/Fisk/copr-mocks
> [15:12:20][DEBUG][dist_git.dist_git_importer][dist_git_importer:415] importing srpm
into the dist-git
> [15:12:20][DEBUG][dist_git.srpm_import][srpm_import:57] repo_dir:
/tmp/tmpFpUmZy/copr-mocks
> [15:12:20][DEBUG][dist_git.srpm_import][srpm_import:77] clone the pkg repository into
tmp directory
> [15:12:20][DEBUG][pyrpkg][__init__:1279] Checking out a specific branch
ssh://copr-dist-git@localhost/mrmeee/Fisk/copr-mocks
> [15:12:20][DEBUG][pyrpkg][__init__:952] Running git clone -b epel7
ssh://copr-dist-git@localhost/mrmeee/Fisk/copr-mocks --origin origin and logging output
> [15:12:20][INFO][pyrpkg][__init__:973] Cloning into 'copr-mocks'...
>
> [15:12:20][DEBUG][dist_git.srpm_import][srpm_import:79] import the source rpm into
git and save filenames of sources
> [15:12:20][DEBUG][pyrpkg][__init__:680] Creating repo object from
/tmp/tmpFpUmZy/copr-mocks
> [15:12:21][DEBUG][pyrpkg][__init__:1105] Running: rpm -qp --nosignature --qf %{NAME}
/tmp/tmphDba9m/package.src.rpm
> [15:12:21][DEBUG][pyrpkg][__init__:1120] Running: rpm -qpl
/tmp/tmphDba9m/package.src.rpm
> [15:12:21][INFO][dist_git.srpm_import][srpm_import:86] save the source files into
lookaside cache
> [15:12:21][ERROR][dist_git.dist_git_importer][dist_git_importer:500] Exception raised
during srpm import:
> Traceback (most recent call last):
> File "/usr/share/copr/dist_git/dist_git_importer.py", line 493, in
do_import
> task.git_hash = self.git_import_srpm(task, fetched_srpm_path)
> File "/usr/share/copr/dist_git/dist_git_importer.py", line 419, in
git_import_srpm
> return do_git_srpm_import(self.opts, filepath, task, tmp)
> File "/usr/share/copr/dist_git/srpm_import.py", line 112, in
do_git_srpm_import
> raise PackageImportException("Failed to import the source rpm:
{}".format(src_filepath))
> PackageImportException: Failed to import the source rpm:
/tmp/tmphDba9m/package.src.rpm
> [15:12:21][DEBUG][dist_git.dist_git_importer][dist_git_importer:465] Sending back:
> {"task_id": "9-epel7", "error":
"srpm_import_failed"}
> [15:12:21][DEBUG][dist_git.dist_git_importer][dist_git_importer:392] 1. Try to get
task data
> [15:12:21][DEBUG][dist_git.dist_git_importer][dist_git_importer:399] No new tasks to
process
>
> Any way to get the importer to throw some more info????
>
> Or anyone who recognize this error...
>
>
>
> What is the version of pyrpkg package on your machine? This is also one of the
trickier errors. To debug that, you need to look into actual_do_git_srpm_import in
dist-git/srpm_import.py.
>
>
>
> When running the script defined in the installation (
https://pagure.io/fork/mrmeee/copr/copr/blob/master/f/dist-git ). .. I get:
>
> [root@copr02 new]# /usr/share/copr/dist_git/dist_git_importer.py
> Traceback (most recent call last):
> File "/usr/share/copr/dist_git/dist_git_importer.py", line 13, in
<module>
> from .exceptions import CoprDistGitException, PackageImportException,
PackageDownloadException, SrpmBuilderException, \
> ValueError: Attempted relative import in non-package
> _______________________________________________
> copr-devel mailing list -- copr-devel(a)lists.fedorahosted.org
> To unsubscribe send an email to copr-devel-leave(a)lists.fedorahosted.org
>
>
>
>
>
> _______________________________________________
> copr-devel mailing list -- copr-devel(a)lists.fedorahosted.org
> To unsubscribe send an email to copr-devel-leave(a)lists.fedorahosted.org
>
>
>
>
> _______________________________________________
> copr-devel mailing list -- copr-devel(a)lists.fedorahosted.org
> To unsubscribe send an email to copr-devel-leave(a)lists.fedorahosted.org
>
>
_______________________________________________
copr-devel mailing list -- copr-devel(a)lists.fedorahosted.org
To unsubscribe send an email to copr-devel-leave(a)lists.fedorahosted.org