=== frankban|afk is now known as frankban [11:10] hello everyone [11:13] hello [13:29] Hi 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] When trying to set it up, I get a: /opt/test/stable/lib/lp/app/browser/../templates/root-index.pt [13:29] Line 72, Column 14 [13:29] Expression: [13:29] - Names: [13:29] {'args': (), [13:29] 'context': , [13:29] 'default': , [13:29] 'loop': {}, [13:29] 'nothing': None, [13:29] 'options': {}, [13:29] 'repeat': {}, [13:29] 'request': , [13:58] Anyone here??? [14:16] newbie|9: I can only really repeat what I said on launchpad-dev: https://lists.launchpad.net/launchpad-dev/msg09809.html [14:16] I'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:25] Pastebin: https://pastebin.com/QH01TpjV [14:26] <-- traceback [14:26] Seems like it can be traced back to the canonical_url function.. [14:27] I think I read something, someplace, that the "base" ubuntu branch has to be set in some way??? [14:30] If 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] The "ubuntu" distribution is indeed one of those. [14:31] ahhh... ok.. and how do I generate these??? [14:35] I have just run the "make schema" [14:37] make 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] It would probably involve manual fiddling with psql ... [14:37] But "make schema" should provide the celebrities???? [14:37] lib/lp/app/utilities/celebrities.py has the list of celebrities that exist. [14:38] It will, yes, but it will also provide other things that aren't suitable for an instance on the internet. [14:38] We'll sort that out, but apparently the celebrity is still not there... [14:38] Like a bunch of template accounts ... [14:39] I've never seen anyone sort that out successfully when starting from sampledata. [14:39] What are you actually trying to do? [14:40] for now, just setting up the development... [14:40] and then hardening... [14:41] Right, but what's your actual goal? [14:41] Having your own Launchpad instance is a pretty gigantic sledgehammer, and most nuts can be cracked with something a bit smaller. [14:42] For 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 Customers [14:43] So, 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:44] It 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:45] Then e.g. trying to evaluate getUtility(ILaunchpadCelebrities).ubuntu to see if it's that. [14:46] If it actually is something inside canonical_url then you can step into that and try to narrow it down a bit. [14:46] Given that you've started from sampledata it's probably something fairly simple, since that normally does work out of the box. [14:46] Ok.. so where did you what to enter getUtility(ILaunchpadCelebrities).ubuntu?? [14:47] At the pdb prompt after you make a request [14:47] 'import pdb; pdb.set_trace()' is a breakpoint [14:47] And I would do that, just before using canonical_url?? or in the canonical_url method [14:48] Before. [14:48] The idea is to try to figure out which part of the apphomes method is raising an exception. [14:48] If you don't already know how to drive pdb, you are going to need to learn. [14:51] ok.. thanks... [15:04] I get a: "expected a string or other character buffer object" on getUtility(ILaunchpadCelebrities).ubuntu)... line 111 in lib/lp/app/browser/root.py... [15:06] p repr(getUtility(ILaunchpadCelebrities).ubuntu) [15:07] (Pdb) p repr(getUtility(ILaunchpadCelebrities).ubuntu) [15:07] *** TypeError: TypeError('expected a string or other character buffer object',) === newbie|9 is now known as MrMEEE [15:11] uh [15:12] ? a little weird? [15:12] from lp.registry.interfaces.pillar import IPillarNameSet [15:12] p getUtility(IPillarNameSet).getByName('ubuntu') [15:13] (should print "") [15:13] (Pdb) from lp.registry.interfaces.pillar import IPillarNameSet [15:13] (Pdb) p getUtility(IPillarNameSet).getByName('ubuntu') [15:13] None [15:13] [15:13] nope [15:14] Then I don't believe that you're running against the database produced by make schema. [15:15] Have 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] sampledata contains that with id 1 [15:16] The database name is set in the [database] rw_main_master and rw_main_slave keys in launchpad-lazr.conf [15:17] Haven't touched it after..... Ipostgres=# \c launchpad_dev [15:17] You are now connected to database "launchpad_dev" as user "postgres". [15:17] launchpad_dev=# SELECT id FROM distribution WHERE name = 'ubuntu'; [15:17] id [15:17] ---- [15:17] (0 rows) [15:17] [15:17] Well, you'll need to work out why make schema didn't put sampledata in place then [15:17] Or else inject the right set of celebrities yourself [15:18] I got this first...: https://pastebin.com/7eY17e3c [15:18] [15:18] and then I ran "sudo -u postgres make create" [15:18] but ok... I'll look into the sampledata [15:19] Ah. That would have been useful to know an hour ago. [15:19] You shouldn't run make schema as root. [15:20] In general you shouldn't run anything Launchpaddish as root. [15:20] Ok.. sry.. It just said that I could run "sudo -u postgres make create"... [15:21] so I presumed that it didn't matter [15:21] Yeah, but it shouldn't have failed in the first place. [15:22] And 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] Ok.. I'll try as a normal user... and see what happens [15:22] Thanks [15:23] Anyway, utilities/launchpad-database-setup sets things up with a DB user corresponding to the mortal user you run it as. [15:23] You should run that (as non-root) if you haven't already. [15:23] And you'll probably need to chown all sorts of things now ... [15:23] I suspect your problem is in fact not having run launchpad-database-setup ... [15:24] ok === frankban is now known as frankban|afk === frankban|afk is now known as frankban