/srv/irclogs.ubuntu.com/2017/04/19/#launchpad-dev.txt

=== frankban|afk is now known as frankban
rajsagarhello everyone11:10
master__hello11:13
newbie|9Hi guys...   I want to setup a local Launchpad server for production.. are there any instructions???..   I have found this: https://dev.launchpad.net/Running.. but it only seems to be for development....13:29
newbie|9When trying to set it up, I get a: /opt/test/stable/lib/lp/app/browser/../templates/root-index.pt13:29
newbie|9Line 72, Column 1413:29
newbie|9Expression: <PathExpr standard:u'view/apphomes'>13:29
newbie|9   - Names:13:29
newbie|9      {'args': (),13:29
newbie|9       'context': <lp.services.webapp.publisher.RootObject object at 0x7f1877d0b810>,13:29
newbie|9       'default': <object object at 0x7f187e0e8430>,13:29
newbie|9       'loop': {},13:29
newbie|9       'nothing': None,13:29
newbie|9       'options': {},13:29
newbie|9       'repeat': {},13:29
newbie|9       'request': <lp.services.webapp.servers.LaunchpadBrowserRequest instance URL=https://launchpad1.phaseone.com/index.html>,13:29
newbie|9Anyone here???13:58
cjwatsonnewbie|9: I can only really repeat what I said on launchpad-dev: https://lists.launchpad.net/launchpad-dev/msg09809.html14:16
cjwatsonI'd need to see the full traceback to debug whatever you're currently seeing (in a pastebin or something, not just pasted into IRC)14:16
newbie|9Pastebin: https://pastebin.com/QH01TpjV14:25
newbie|9<-- traceback14:26
newbie|9Seems like it can be traced back to the canonical_url function..14:26
newbie|9I think I read something, someplace, that the "base" ubuntu branch has to be set in some way???14:27
cjwatsonIf you're running with a completely empty database then you're probably missing some of the "celebrities" that the Launchpad code relies on.14:30
cjwatsonThe "ubuntu" distribution is indeed one of those.14:30
newbie|9ahhh... ok.. and how do I generate these???14:31
newbie|9I have just run the "make schema"14:35
cjwatsonmake schema will give you sampledata, which is insecure for a new production instance.  I'm not aware of any documentation on setting up a new non-development instance entirely from scratch.14:37
cjwatsonIt would probably involve manual fiddling with psql ...14:37
newbie|9But "make schema" should provide the celebrities????14:37
cjwatsonlib/lp/app/utilities/celebrities.py has the list of celebrities that exist.14:37
cjwatsonIt will, yes, but it will also provide other things that aren't suitable for an instance on the internet.14:38
newbie|9We'll sort that out, but apparently the celebrity is still not there...14:38
cjwatsonLike a bunch of template accounts ...14:38
cjwatsonI've never seen anyone sort that out successfully when starting from sampledata.14:39
cjwatsonWhat are you actually trying to do?14:39
newbie|9for now, just setting up the development...14:40
newbie|9and then hardening...14:40
cjwatsonRight, but what's your actual goal?14:41
cjwatsonHaving your own Launchpad instance is a pretty gigantic sledgehammer, and most nuts can be cracked with something a bit smaller.14:41
newbie|9For our Red Hat customers we are using COPR, for our SLES customers we are using OBS.. So we just want something similiar for our Ubuntu Customers14:42
cjwatsonSo, like I said on launchpad-dev, our practical purpose in open-sourcing Launchpad was mainly to make it easier for people to help with improving launchpad.net.  For setting up your own instance you're basically on your own.14:43
cjwatsonIt might be worth inserting 'import pdb; pdb.set_trace()' into the apphomes method in lib/lp/app/browser/root.py and seeing where it's going wrong exactly.14:44
cjwatsonThen e.g. trying to evaluate getUtility(ILaunchpadCelebrities).ubuntu to see if it's that.14:45
cjwatsonIf it actually is something inside canonical_url then you can step into that and try to narrow it down a bit.14:46
cjwatsonGiven that you've started from sampledata it's probably something fairly simple, since that normally does work out of the box.14:46
newbie|9Ok.. so where did you what to enter getUtility(ILaunchpadCelebrities).ubuntu??14:46
cjwatsonAt the pdb prompt after you make a request14:47
cjwatson'import pdb; pdb.set_trace()' is a breakpoint14:47
newbie|9And I would do that, just before using canonical_url?? or in the canonical_url method14:47
cjwatsonBefore.14:48
cjwatsonThe idea is to try to figure out which part of the apphomes method is raising an exception.14:48
cjwatsonIf you don't already know how to drive pdb, you are going to need to learn.14:48
newbie|9ok.. thanks...14:51
newbie|9I get a: "expected a string or other character buffer object" on getUtility(ILaunchpadCelebrities).ubuntu)... line 111 in lib/lp/app/browser/root.py...15:04
cjwatsonp repr(getUtility(ILaunchpadCelebrities).ubuntu)15:06
newbie|9(Pdb) p repr(getUtility(ILaunchpadCelebrities).ubuntu)15:07
newbie|9*** TypeError: TypeError('expected a string or other character buffer object',)15:07
=== newbie|9 is now known as MrMEEE
cjwatsonuh15:11
MrMEEE? a little weird?15:12
cjwatsonfrom lp.registry.interfaces.pillar import IPillarNameSet15:12
cjwatsonp getUtility(IPillarNameSet).getByName('ubuntu')15:12
cjwatson(should print "<Distribution 'Ubuntu' (ubuntu)>")15:13
MrMEEE(Pdb) from lp.registry.interfaces.pillar import IPillarNameSet15:13
MrMEEE(Pdb) p getUtility(IPillarNameSet).getByName('ubuntu')15:13
MrMEEENone15:13
MrMEEE 15:13
MrMEEEnope15:13
cjwatsonThen I don't believe that you're running against the database produced by make schema.15:14
cjwatsonHave a look with psql (the default database name is launchpad_dev, but you should check with psql -l in case you're actually using something else): SELECT id FROM distribution WHERE name = 'ubuntu';15:15
cjwatsonsampledata contains that with id 115:15
cjwatsonThe database name is set in the [database] rw_main_master and rw_main_slave keys in launchpad-lazr.conf15:16
MrMEEEHaven't touched it after..... Ipostgres=# \c launchpad_dev15:17
MrMEEEYou are now connected to database "launchpad_dev" as user "postgres".15:17
MrMEEElaunchpad_dev=# SELECT id FROM distribution WHERE name = 'ubuntu';15:17
MrMEEE id15:17
MrMEEE----15:17
MrMEEE(0 rows)15:17
MrMEEE 15:17
cjwatsonWell, you'll need to work out why make schema didn't put sampledata in place then15:17
cjwatsonOr else inject the right set of celebrities yourself15:17
MrMEEEI got this first...: https://pastebin.com/7eY17e3c15:18
MrMEEE 15:18
MrMEEEand then I ran "sudo -u postgres make create"15:18
MrMEEEbut ok... I'll look into the sampledata15:18
cjwatsonAh.  That would have been useful to know an hour ago.15:19
cjwatsonYou shouldn't run make schema as root.15:19
cjwatsonIn general you shouldn't run anything Launchpaddish as root.15:20
MrMEEEOk.. sry.. It just said that I could run "sudo -u postgres make create"...15:20
MrMEEEso I presumed that it didn't matter15:21
cjwatsonYeah, but it shouldn't have failed in the first place.15:21
cjwatsonAnd the message is a bit misleading.  It's only saying how to make that *particular* bit of the Makefile work, but there's more to it than 'make create'.15:22
MrMEEEOk.. I'll try as a normal user... and see what happens15:22
MrMEEEThanks15:22
cjwatsonAnyway, utilities/launchpad-database-setup sets things up with a DB user corresponding to the mortal user you run it as.15:23
cjwatsonYou should run that (as non-root) if you haven't already.15:23
cjwatsonAnd you'll probably need to chown all sorts of things now ...15:23
cjwatsonI suspect your problem is in fact not having run launchpad-database-setup ...15:23
MrMEEEok15:24
=== frankban is now known as frankban|afk
=== frankban|afk is now known as frankban

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!