Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Unable to install fedora package database #13

Closed
msmahmood opened this issue Nov 17, 2013 · 15 comments
Closed

Unable to install fedora package database #13

msmahmood opened this issue Nov 17, 2013 · 15 comments

Comments

@msmahmood
Copy link

I am currently working on a project to port fedpkg to pidora. We have set up a gitserver already, the second was to set the fedora package database modify it to contain pidora packages. However, I am having issues install fedora package database.

  • Downloaded the package from https://fedorahosted.org/releases/p/a/packagedb
    It comes with a README file, I was trying to follow it along but having issues where it says set up the cron jobs.
    For example it says set this up as a cron job "server-scripts/pkgdb-sync-yum update"

first, the script's name is "pkgdb-sync-yum.in", so i renamed it to "pkgdb-syn-yum" then i tried to run it with "update" option and this is what I get:

Traceback (most recent call last):
File "./pkgdb-sync-yum", line 51, in
import pkg_resources
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2655, in
working_set.require(requires)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: fedora-packagedb

I ignored this, as this has to do with database update and moved on to set up the webserver, I do as I am asked in the README file, but I get a 403 forbidden when I try to access the page with "/pkgdb" Alias.

Can I get some help please?

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

@abadger
Copy link
Contributor

abadger commented Nov 17, 2013

Are you porting fedpkg or crating your own packages infrastructure like Fedora has? If the former, you do not need to run your own packagedb. If the latter you may.

The reason the pkgdb-sync-yum script isn't working for you is that you have to tell it where the pkgdb python module and the fedora-packagedb egg-info for the pkgdb python module is installed. When the setup.py is run with certain arguments, setup.py substitutes those paths for you. If you simple rename pkgdb-syn-yum.in, then you'd have to substitute those variables yourself.

Also -- You may want to look into running pkgdb2 instead of packagedb. We're planning on deploying pkgdb2 in fedora infrastructure in January.

@abadger
Copy link
Contributor

abadger commented Nov 17, 2013

This is the portion of the README that you skipped over :-): https://github.com/fedora-infra/packagedb/blob/develop/README#L67

@msmahmood
Copy link
Author

Thanks for the quick reply, I was actually going to email you. Anyhow, to continue, I am porting fedpkg to pidora, and I was told it would be a good idea to install fedora package database first and then modify it for pidora packages so fedpkg can pull information from it. I am still sort of confused, as this is my first time ever porting anything. So this is my goal, I want to make sure fedpkg runs on pidora for pidora packages, how should I go about it?

I appreciate your help very much. I almost lost hope.

@msmahmood
Copy link
Author

I was told that there are three pieces to it, one is a git server, Fedora Package Databse and HTTP server. The git part was configured by someone before me. I am a student at Seneca College working with CDOT.

@msmahmood
Copy link
Author

I tried to build it from scratch again, when I get to the paver command, it gives me this:
paver build --install-conf=pwd --install-data=pwd --install-sbin=pwd

Traceback (most recent call last):

File "/usr/bin/paver", line 9, in

load_entry_point('Paver==1.1.1', 'console_scripts', 'paver')()

File "/usr/lib/python2.7/site-packages/paver/tasks.py", line 816, in main

_launch_pavement(args)

File "/usr/lib/python2.7/site-packages/paver/tasks.py", line 785, in _launch_pavement

execfile(environment.pavement_file, mod.__dict__)

File "pavement.py", line 16, in

from turbogears.finddata import find_package_data

File "/usr/lib/python2.7/site-packages/turbogears/init.py", line 9, in

from turbogears.config import update_config

File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 4, in

pkg_resources.require("CherryPy<3.0")

File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 690, in require

needed = self.resolve(parse_requirements(requirements))

File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 592, in resolve

raise VersionConflict(dist,req) # XXX put more info here

pkg_resources.VersionConflict: (CherryPy 3.2.2 (/usr/lib/python2.7/site-packages), Requirement.parse('CherryPy<3.0')

I am a complete noob when it comes to python scripts so I am not sure what to make of this.

@abadger
Copy link
Contributor

abadger commented Nov 19, 2013

Ah -- I think that this might be a problem with paver (I've been trying to migrate other projecs away from paver for similar reasons).

Try this:

$ cp /usr/bin/paver paver.local
$ sed 's/__requires__ = .*/__requires__ = ["Paver", "CherryPy < 3.0"]/' < paver.local > paver
$ ./paver build --install-conf=`pwd` --install-data=`pwd` --install-sbin=`pwd`

@msmahmood
Copy link
Author

That worked! However, now i have an issue with the pkg-sync-yum command. It seems to be the same issue with "required" field in pkg_resources.

[root@localhost server-scripts]# chmod 755 pkgdb-sync-yum
[root@localhost server-scripts]# ./pkgdb-sync-yum update -h
Traceback (most recent call last):
File "./pkgdb-sync-yum", line 51, in
import pkg_resources
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2655, in
working_set.require(requires)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: fedora-packagedb

Any ideas? Thanks for all your help. I will move on with rest of the configurations.

@msmahmood
Copy link
Author

I carried on with the instructions, ignoring the pgkdb update, then I get a 500, saying pkgdb.wsgi was unable to find tg.utils

[Tue Nov 19 03:56:48.296164 2013] [:error] [pid 3211] [remote ::1:2488] mod_wsgi (pid=3211): Target WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi' cannot be loaded as Python module.
[Tue Nov 19 03:56:48.296209 2013] [:error] [pid 3211] [remote ::1:2488] mod_wsgi (pid=3211): Exception occurred processing WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi'.
[Tue Nov 19 03:56:48.296229 2013] [:error] [pid 3211] [remote ::1:2488] Traceback (most recent call last):
[Tue Nov 19 03:56:48.296248 2013] [:error] [pid 3211] [remote ::1:2488] File "/home/hitman/Public/packagedb/pkgdb.wsgi", line 19, in
[Tue Nov 19 03:56:48.296300 2013] [:error] [pid 3211] [remote ::1:2488] import fedora.tg.utils
[Tue Nov 19 03:56:48.296317 2013] [:error] [pid 3211] [remote ::1:2488] ImportError: No module named tg.utils

@abadger
Copy link
Contributor

abadger commented Nov 19, 2013

Are you installing on fedora? I'm guessing yum install python-fedora-turbogears would fix that error.

Are you on IRC.freenode.net? We may want to talk about whether you really want to deploy packagedb or if you want to start with pkgdb2.... This code base won't be supported for much longer....

@msmahmood
Copy link
Author

Yes I am, my nick is msmahmood. When are you available?
If I can make fedpkg work with packagedb2 then I can install it. Its just that I am missing a lot of details that is why I am being prudent.


From: Toshio Kuratomi notifications@github.com
Sent: Tuesday, November 19, 2013 3:27 PM
To: fedora-infra/packagedb
Cc: Mohammad Shaheer Mahmood
Subject: Re: [packagedb] Unable to install fedora package database (#13)

Are you installing on fedora? I'm guessing yum install python-fedora-turbogears would fix that error.

Are you on IRC.freenode.net? We may want to talk about whether you really want to deploy packagedb or if you want to start with pkgdb2.... This code base won't be supported for much longer....

Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-28829822.

@msmahmood
Copy link
Author

After installing pythone-fedora-turbogears:
[Tue Nov 19 23:09:07.816671 2013] [:error] [pid 2494] [remote ::1:6073] mod_wsgi (pid=2494): Target WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi' cannot be loaded as Python module.
[Tue Nov 19 23:09:07.816714 2013] [:error] [pid 2494] [remote ::1:6073] mod_wsgi (pid=2494): Exception occurred processing WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi'.
[Tue Nov 19 23:09:07.816733 2013] [:error] [pid 2494] [remote ::1:6073] Traceback (most recent call last):
[Tue Nov 19 23:09:07.816757 2013] [:error] [pid 2494] [remote ::1:6073] File "/home/hitman/Public/packagedb/pkgdb.wsgi", line 24, in
[Tue Nov 19 23:09:07.816809 2013] [:error] [pid 2494] [remote ::1:6073] modulename="pkgdb.config")
[Tue Nov 19 23:09:07.816821 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 219, in update_config
[Tue Nov 19 23:09:07.816892 2013] [:error] [pid 2494] [remote ::1:6073] configdict = config_obj(configfile, modulename).dict()
[Tue Nov 19 23:09:07.816904 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 174, in config_obj
[Tue Nov 19 23:09:07.816923 2013] [:error] [pid 2494] [remote ::1:6073] modname + '.cfg')
[Tue Nov 19 23:09:07.816933 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in resource_filename
[Tue Nov 19 23:09:07.817317 2013] [:error] [pid 2494] [remote ::1:6073] return get_provider(package_or_requirement).get_resource_filename(
[Tue Nov 19 23:09:07.817329 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 180, in get_provider
[Tue Nov 19 23:09:07.817345 2013] [:error] [pid 2494] [remote ::1:6073] import(moduleOrReq)
[Tue Nov 19 23:09:07.817360 2013] [:error] [pid 2494] [remote ::1:6073] ImportError: No module named pkgdb

@pypingou
Copy link
Member

Looks like the wsgi files does not find the pkgdb module present in the packagedb repository.

Btw, I saw you passed by on #fedora-apps but it was too early for me and probably too late for @abadger

@msmahmood
Copy link
Author

That's ok, let me know a good time so I will come onlline at that time. Btw I was not able to run the yum-sync-pkgdb script, is this related to that?

@pypingou
Copy link
Member

I am in Europ, @abadger is in the US so if you come by during day time of one of these two area one of us should be there.

@pypingou
Copy link
Member

Ok, let's close this ticket has the reporter has managed to get pkgdb2 running.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants