*** ibr has joined #gnuenterprise Hello all! I'm still trying to build "Hello, world". I've installed postgres and gnue-* packages. I don't understand how I should proceed. Could anyone please help? Installed pkgs (debian): postgresql-8.0 python2.3-pygresql gnue-appserver gnue-common gnue-designer gnue-forms gnue-reports /etc/gnue/connections.conf: [gnue] provider = pygresql host = localhost dbname = gnue template1=# \l List of databases Name | Owner | Encoding -----------+----------+----------- gnue | gnue | UNICODE template0 | postgres | SQL_ASCII template1 | postgres | SQL_ASCII (3 rows) hello ibr you should start gnue-appserver somehow and then use gnue-forms to access data in there Aha, let me see... No processes named *gnue*. /etc/init.d/gnue-appserver start Starting gnue-appserver: gnue-appserver Exporting our services via xmlrpc (port 8765) ... Reloading class repository ... gnue-appserver: Unable to log in after 4 attempts. Error: fe_sendauth: no password supplied dimas: How should I specify the username and password in connections.conf? I do not have them set in mine does postgres allow you to connect from the current user? *** yure has joined #gnuenterprise dimas: Yes, but gnue-appserver works as root. dimas: I can set that for testing in the postgres config. dimas: Are there any docs on connections.conf? dimas: Hmm, I have "local all all trust" in /etc/postgresql/8.0/main/pg_hba.conf :/ . try to run psql gnue from the user you start appserver from what it gives? or better: psql -h gnue dimas: psql: FATAL: password authentication failed for user "root" can you start appserver from non-root user? otherwise you need to create user root in postgres Hmm, never tried. *** johannesV has joined #gnuenterprise good morning good morning good morning DB000: File "/usr/lib/gnue/python/gnue/common/apps/GServerApp.py", line 184, in __createPidFile DB000: pidfile = open (self.OPTIONS ['pidfile'], 'w') DB000: IOError: [Errno 13] Permission denied: '/var/run/gnue/appserver.pid' ah If there are no docs on connections.conf, how can I trace python execution? johannesV: how is better to set it for ibr for full install ? appserver is run from root does he need to createuser root in postgres? have not used full install for a long time dimas: I could, but I'd rather give user gnue in connections.conf. dimas: You mean, there is also not full install? W/o app server? ibr: gnue-appserver --help for debug options ibr: there is cvs install when all run from current user/dir dimas: I guess this is logging built into the app-server. Is there a python debugging facility? dimas: Ah, I see. may be not available if you installed from release packages dimas: If it is easier with cvs install, let's try that. ibr: postgres has createuser command to create new user dimas: Yes, do you mean I should create user root? user = self.OPTIONS ['username'] or 'gnue' may be, try to do dimas: The above line from geasRpcServer.py makes me unsure about that. dimas: How can I see which user it is connected with? hm have not reinstalled gnue and postgres for ages, may be johannes can help ibr: try to add debug-level ibr: and i do have gnue user in postgres Aha. Let me see... ibr, appserver is usually run by a privileged useraccount which has access to /var/run/gnue*. usually this directory should be created by the package-management used for installation having the proper access privileges so if you start appserver as 'normal' user make sure to have enough permission to write to /var/run/gnue/* dimas: psql -U gnue gnue works. johannesV: Yes, I'm starting it with root, but postgres connection fails. check also with -h option dimas: Ah, this asks for password. connecting from appserver or from forms johannesV: gnue-appserver: Unable to log in after 4 attempts. ah, ok johannesV: Error: fe_sendauth: no password supplied you have a password set in your connections.conf ? johannesV: No. password = xxx The syntax is like above? yes correct for the logs: btami, the dropdown-problem is a known issue and Vadim Zeitlin is trying to look at it this weekend (thread: http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?5:sss:69454:200601:angkeknejgglpdmmjaod#b) - meanwhile i'd prefer using wx 2.6.1.0 as it is working perfectly with that version psql -U gnue -h localhost gnue succeeds with a password. gnue-appserver doesn't start with the same error messages. postres log says: LOG: could not receive data from client: Connection reset by peer Aha, setting username = gnue in connections.conf helped. gnue-appserver: error 'ERROR: relation "gnue_module" does not exist ' in 'SELECT gnue_name, gnue_id FROM gnue_module ORDER BY gnue_id' I suppose it's time to import the schema. ibr, great . that's right. you can run gnue-schema with the gnue.gsd (located in the share-directory) *** Morphous has joined #gnuenterprise It said the following: http://www.radix50.net/~ibr/setup-db.sh.log :( . gnue=> \dt No relations found. ibr, you've to use "gnue-schema" to install the schema defined in gnue.gsd change to the folder where you have the gnue.gsd file *** Amorphous has quit IRC then call something like gnue-schema gnue.gsd Ah, yes. it seems as if you've tried to import sample.gsd ... didn't you ? Yes :) . sample.gsd provides sample-data for the sample-classes while gnue.gsd contains the database-schema for appserver's class repository Ok, seven tables in the gnue DB. great, now you can import the sample-classes do that with "gnue-readgcd sample.gcd" johannesV: What do I need them for? oh, you don't need them i thought you'd like to try it out a bit ... Yes, I want to run a Hello, World app. But I don't understand which sample app these data belong to. there is a form called sample.gfd (form definition) which uses that sample-classes (address_country and address_person) (from sample.gcd) Aha, great. Do I need to restart the appserver after I import the data for sample? no, not after importing data; after importing new classes either restart appserver, or send a SIGHUP to the appserver process (as this will reload the classrepository) you might want to read the developers guide for appserver Will do. there are most of the concepts explained quite easily how to create classes, properties, triggers and much more But I'd like to see *anything* running first :) . GNUe Application Server up and running How can I build and run the sample application? well, have you imported the sample.gcd ? Yes. ok, and sample.gld ? No. gnue-readgld? C or de? yeah, but it is quite optional (as it provides translations only) So, if I don't import sample.gld, the app will be in English? doesn't matter yes and no; the provided gld contains translations for the sample classes - but these translations will be used only, if you use appserver's generated forms so if you plan to just quickly check sample.gfd the *.gld are of no use to you Ok, what should I do now? ok, said that, after import sample.gsd (using gnue-schema again) you can just fire up sample.gfd (using something like "gnue-forms sample.gfd") readgsd: error 'do not know how to handle type ' in 'INIT' what ? you're using a postgres, right ? Yes. which driver are you using ? psycopg, pypgsql, pygresql ? provider = pygresql is this the only one you've installed ? (or do you have psycopg available) I should. hm, but it works fine for me using the pygresql That's python2.3-pygresql. Hmm, worked with psycopg. What's the difference, why three drivers for the same thing? ok, ibr, i can reproduce this problem if i create the classes using the pygresql driver gnue-forms sample.gfd gave a traceback http://www.radix50.net/~ibr/mc77.png this looks like you've not restarted (or sighuped) your appserver ? btw, are you using KDE ? wrt to the datetimedelta-problem, it looks like pygresql creates a mx.DateTimeDelta object for time values, but finally isn't able to handle them ... (will investigate it) yeah, that's obviously a bug in pgdb.py the _quote () function only handles mx.DateTime types but not mx.DateTimeDelta's which it creates itself in the typecast function ... hm, bad bad ... anyway it's better to use the psycopg driver as it is the one known to work best ... Hmm, seems debian's init.d script is buggy, restarted by hand, it worked. I'm not using KDE. Aha, good to know. Ok, I see the forms. How should I build and run the app? you've got your form shown ? that is the app :) you should now be able to add/modify person- and country-records *** btami has joined #gnuenterprise hi all johannesV: tried it with 2.6.1.0, and it's ok thx btami, no problem. i was quite shocked after seeing that the newer version breaks such basic things yes, annoying... wrt the page-switching problem, I've not found the pb right now ... as it works fine with changes done by keyboard since the ui-widget get's a SetFocus () command ... which seems to be just ignored by wx but it looks like my last post yesterday has initiated a fix of the dropdown-problem ok, have to run now ... i'm back in a while *** btami has quit IRC back *** Morphous is now known as Amorphous *** reinhard has joined #gnuenterprise *** sacha has quit IRC *** johannesV_ has joined #gnuenterprise *** johannesV has quit IRC *** johannesV_ has quit IRC *** johannesV has joined #gnuenterprise *** jamest has joined #gnuenterprise *** sjc has joined #gnuenterprise do we have a real test schema for gnue? you mean we should test our code? er, no, of course not seriously, I think we have some do-all-tests scripts or something IIRC at least in common i mean db structures ah I always use zipcode and the appserver sample i've got that object wrapper thing I've talked about implemented at ajrs and want to put in gnue-common at work i've got two talbes not trying to hold you back, but didn't you want to put it in gnue-contrib? i menat contrib sorry it's in my ajrs common :) but my unit tests for it bang on 2 tables prodepm=> select * from test_master_table prodepm-> ; master_id | decimal_field | txt_field | bool_field -----------+---------------+-----------+------------ 2 | 0.02 | Master 2 | f 1 | 0.01 | Master 1 | t and prodepm=> select * from test_detail_table ; detail_id | value -----------+---------- 1 | OneTwo 1 | OneThree 1 | OneFour 1 | OneFive 2 | TwoOne 2 | TwoTwo 1 | OneOne (7 rows) not exactly robust :) i was hoping maybe we had something like MS's northwind db setup what is that? it's a complete schema for a business as a sample ah http://www.pwsdb.com/pgm/tutorial-view.php?topic=18 the 2 tier variant of the appserver sample might be a start for that where is that at? I can't find it :( sigh well, i've actuall y we need to consolidate our samples and test forms * jamest looks around reinhard: lean over here * jamest whispers most of them are not maintained and not kept up to date I've got time to GNUe some and shipping a sample with the code that doesn't work is bad great to hear that i was thinking about doing that cleanup of samples so I can start some unit tests i've fallen in love with them at work ask kilo/btami for the 2 tier appserver sample have > 100 tests IIRC they have done it how would you want the samples done? in gnue-samples or in the per app samples dir if we will build a southwind sample or something like that I'd prefer to have it in the gnue-samples dir as it will be gpd, gfd, grd and everything i was thinking about a gnue-testkit which is really just gnue-samples I guess as for unittests I would think they should be per package oh yes they overwhelm otherwise but all of them might rely on the data from the testkit yes that is how I do it at work but for gnue i could see a testkit that builds the "gnue" database we default to then all app samples could reference that structure erm and all unittests would expect that to exist yes that's actually what I meant :) so would this be the same as gnue-samples? yes and we just cleanup what's there? but again I would prefer a *single* well-maintained sample i agree well, 2 yes right one 2-tier and one appserver as the test schema would work in 2tier yeah, that where they could even be the same in principle just ported to appserver and the sample would not only contain the schema but also some data that would really be great to have reinhard: will you be here today? for a while? as I figure this all needs to be in gnue-schema not sure but could well be wow we have quite a few gsd babyerp gnue-sb gnue-samples/testcases/appserver/appservertest.gsd is that the sample? no, that's a very old test form/gsd for appserver which should be deleted immediately FWIW I just thought about using xnee for UI testing but I haven't looked at it at all it's just a means to record things in X hmmm..... another idea could be to create a scriptable pseudo-uidriver which takes its events from a file instead of mouseclicks brb, off to watch news on tv ok back reinhard: is it better to have one gsd or can you easily load a whole dir of them? jamest, you could pass in a bunch of gsd's into a single call of gnue-schema all that tables are then sorted to fulllfill all dependecies ok I can't find the appserver sample gnue-appserver/samples/* the 2tier? ah, that i don't know ... what's in the appserver sample? i was thinking it was country and something last I loked address_country and address_person i was hoping to do something a little bigger say a customer/invoice thing is there a proper way to deal with postal codes internationally * jamest is starting with the zipcode sample and so I have zipcode and state which are kinda americanized :) what do you mean with 'proper way to deal' ? well if I do a customer db I'm going to have attention1, attention2, address1, address2, city, state, zip i'm pretty sure you'd have something different for city, state, zip so if there are more international names for those things I'd prefer to use them like maybe locality, district, postal code i don't know how this would be called 'internationally', but we call it country, city, zip here ... why does gnue-schema want to create a gnue user even if I pass in a -u option? is that by design? it's usually postal code in british english and for most of europe, the order is "zip city" and as most countries in europe are a little bit smaller than the US, there is no need for a state ok does appserver use gnue-schema directly or just as a lib as it's really acting wack appserver does use gnue-schema to bootstrap the db odd johannesV: you still here? as it's ignoring -u yeah hmmm and sometimes it prompts for passwd and sometimes not or it'll prompt for passwd johannesV: can you help jamest on this? i'll enter it ah, you mean that random-generator integrated into gnue-schema ? prompt again i'll enter it tell me databse created prompt again gnue-schema uses common's connection for authentication ... and now it's asking for a differnet user must run, bbl jamest, what kind of db are you using ? postgresql hm i'm updating to 8.1.3 now oh haven't tried with an 8.* well, let me have a look at this which driver are you using ? gsscvs -c gnue -d -u dbadmin *.gsd [gnue] comment = Production DB(G) provider = psycopg host = gnue dbname = gnue ok, so it should actually use the username 'dbadmin' for connecting to db gnue on host gnue that was what I was trying but username = self.connection.parameters.get ('username', 'gnue') password = self.connection.parameters.get ('password', 'gnue') if self.OPTIONS ['username'] is not None: username = self.OPTIONS ['username'] if self.OPTIONS ['password'] is not None: password = self.OPTIONS ['password'] self.connection.parameters ['_username'] = username self.connection.parameters ['_password'] = password so, the connection should use the username/password provided on the commandline amest@calvin:~/svn/gnue/gnue-samples/schema$ gsscvs -c gnue -d -u dbadmin *.gsd You are about to create the new database 'gnue'. Continue [y,N]: y Password: Password: createuser: could not connect to database template1: FATAL: password authentication failed for user "jamest" ah, got the first bug then in _createDatabase_ of sql.postgresql.Behvior i do a query of the connection.parameter ['username'] instead of _username same applies to password have to double-check wether it's better to change _username into username or vice versa jamest, could you give it another try ? sure i need to finish the upgrade to 8.1.3,just a sec is this line ok? gsscvs -c gnue -d -u dbadmin *.gsd yes, should be i would think i'm telling it create 'gnue' via user dbadmin jamest@calvin:~/svn/gnue/gnue-samples/schema$ gsscvs -c gnue -d -u dbadmin *.gsd You are about to create the new database 'gnue'. Continue [y,N]: y Password: Password: createuser: could not connect to database template1: FATAL: password authentication failed for user "jamest" self.addCommandOption ('username', 'u', argument="user", help = _("Set the username for the database. If the database is to be " "created, this username will be it's owner.")) so it's not the name used to do the creation? as in my case I have a master user 'dbadmin' which owns all production tables no, have a look at datasources.drivers.postgresql.Behavior the user given on the commandline (or the config-file) will be created first, in order to become the owner of the newly created db i don't have that module ah, sorry, wrong path "drivers/sql/postgresql/Behavior.py" ok so in my case I'm in trouble as I don't have a real dbadmin account on the system maybe we should consider adding another argument to gnue-schema, specifying a user used for issuing the createdb-command only in postgresql i would think -u username to login as --username and --owner --owner username to own would be better right where --owner defaults to --username if not given yes i think i'll add this tomorrow ok, for today i'll manually create the db or you could do it if you like (or need it) right now i'll hold off unless I hit another issue i really want to get something done with a test setup and digging thru datasources will suck a bit of time ok, no problem --- I'll go and fix that tomorrow thanks will read the logs anyway, so don't hesitate on dropping other reports in here ... have to run now ... happy coding ! thanks *** johannesV has quit IRC *** sacha has joined #gnuenterprise johannesV********************************* a few things the technote references a type='key' that doesn't seem to exist in the drivers anymore would there be some advantage to having it drop and recreate tables if a flag is set as if I change the schema then i have to drop the altered tables/sequences automatically if I don't drop the sequence it aborts *** kilo has joined #gnuenterprise reinhard: wb i've been breaking gnue-schema nice ;-) seems like it's been some time since it has been used extensively well i'm creating a testkit starting w/ an invoice it's not suited for real world invoicing but it hits quite a few gotchas in tables (at least I think) and gsscvs hates it :) in gnue-samples how should we lay this out i have a gnue-samples/schema directory but i'm not sure how/where the appserver stuff should go would we be better served by something like maybe have a gnue-samples/2tier/schema er, close to what I was thinking i was thinking data/2tier data/appserver or were you thinking of 2tier/tests appserver/tests wait, those wouldn't go in there right 2tier/schema 2tier/forms 2tier/reports appserver/objects appserver/forms appserver/reports but I'm not sold on that :) it's easy enough to change i'm assuming I can ditch the tutorials and testcases dirs and move the stuff to where it fits better also I think so i'm working from the assumption that unit tests are going to expect /usr/local/pgsql/bin/dropdb gnue (I have never done anything in gnue-samples, so I'm not the one to decide that) a fresh gnue db yes, that's what we have always done with our tests in appserver and it sounds reasonable i wish gnue-schema could deal with changes in the structure better or an option to overwrite the existing db structures if passed a flag --reset-db or something to that effect so far, we deliberately didn't make gnue-schema delete anything that is already there i can understand taht just to not have the risk of accidentally deleting things but how do you deal with schema changes as it seems to ignore them it should work with adding columns maybe I only changed column types changing the type of an existing column is probably not possible for most backends except with dropping and creating it again which will lose all data while I'm thinking of it and if you have no data anway, you can easily drop the whole table and generate it again from scratch it'd be nice to be able to define comments on tables fields as at work I use postgresql's comment on to comment everything good idea i may take a look at that great as I think i've hit something I can't get around without debugging DB000: MissingKeyFieldError: Key field(s) 'invoice_address_id' missing in row '2' of table 'invoice_address' my row 2 is 1 also, is there a way to set starting sequence values as if I setup a field with a serial and it's the pk not that I know of it's probably something that works completely differently for all backends btw if you change stuff in the postgres provider please write a short summary so johannes can look into adapting the other drivers as well then i have to provide a value for that field in the data section where as if it's not the pk then it'll let it by and default which means on a pk field populated in the gsd your sequence is going to contain values you've already used a starting sequence value option would let me set the starting invoice number at say 1000 and let me insert test invoices starting at 0 i see * jamest pictures reinhard setting in front of his computer why god? why? we didn't want him mucking about in here anymore. not now that it's clean jamest: I really appreciate your input, seriously! :-) and even more your upcoming code ;-) i'll try i really want to get back in but by the time i leave work I'm shot and though work is ok with me GNUe'n i've got a lot to get done there just on the basics here is the current gnue-schema issue gsscvs -c gnue -u dbadmin -p *.gsd readgsd: ERROR: there is no unique constraint matching given keys for referenced table "items" ALTER TABLE invoice_item ADD CONSTRAINT fk_invoice_item_sku FOREIGN KEY (sku) REFERENCES items (sku) gsscvs -c gnue -u dbadmin -p items.gsd gsscvs -c gnue -u dbadmin -p *.gsd time for a pizza run bedtime actually past bedtime :) good night all *** reinhard has quit IRC *** ibr has quit IRC *** jamest has left #gnuenterprise *** yure has quit IRC *** kilo has left #gnuenterprise *** derek has quit IRC *** derek has joined #gnuenterprise *** sjc has quit IRC *** ibr has joined #gnuenterprise *** gerold has joined #gnuenterprise *** krizz has joined #gnuenterprise