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