Sahana-eden First run error

339 views
Skip to first unread message

kasun perera

unread,
Jun 29, 2011, 1:03:08 PM6/29/11
to sahan...@googlegroups.com

Hi

I installed an configured sahana-eden on my ubuntu 10.10 machine according to the following document on sahana wiki.

http://eden.sahanafoundation.org/wiki/InstallationGuidelinesDeveloper

When I run run the web2py server first time and go to sahana it gives me the following error.

Internal error

Ticket issued: eden/127.0.0.1.2011-06-29.22-13-29.86b9094e-37bb-43dd-9b03-7fe93c2188c5

Version

web2py™

Version 1.92.1 (2011-03-01 09:16:48)

Python

Python 2.6.6: /usr/bin/python

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
Traceback (most recent call last):
  File "/home/kasun/web2py/gluon/restricted.py", line 188, in restricted
    exec ccode in environment
  File "/home/kasun/web2py/applications/eden/models/000_1st_run.py", line 18, in <module>
    s3base = local_import("s3")
  File "/home/kasun/web2py/gluon/compileapp.py", line 237, in <lambda>
    local_import_aux(name,reload,app)
  File "/home/kasun/web2py/gluon/compileapp.py", line 168, in local_import_aux
    module = __import__(name)
  File "applications/eden/modules/s3/__init__.py", line 70, in <module>
    from s3crud import *
  File "applications/eden/modules/s3/s3crud.py", line 58, in <module>
    from s3pdf import S3PDF
  File "applications/eden/modules/s3/s3pdf.py", line 103, in <module>
    class S3PDF(S3Method):
  File "applications/eden/modules/s3/s3pdf.py", line 895, in S3PDF
    class S3PDFOCRForm(BaseDocTemplate):
NameError: name 'BaseDocTemplate' is not defined

However in first time configuration of web2py and sahana I didn't configure the optional configurations mentioned in above document(Specially the database).

Then after receiving this error I configured the MySql database (create a empty sahana database)as indicated in the optional requirements.

Is it necessary to configure a database before running sahana-eden?

Same kind of problem is reported as a sahana bug here: https://bugs.launchpad.net/sahana-eden/+bug/739250 , but it says its fixed-committed.

How do I overcome this error?

Thank you

Shiv Deepak

unread,
Jun 29, 2011, 1:32:19 PM6/29/11
to sahan...@googlegroups.com
It is a problem due to reportlab. let me have a look.

--
Shiv Deepak


--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sahana-eden/-/4suaERlyaXoJ.
To post to this group, send email to sahan...@googlegroups.com.
To unsubscribe from this group, send email to sahana-eden...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sahana-eden?hl=en.

Shiv Deepak

unread,
Jun 29, 2011, 1:39:33 PM6/29/11
to sahan...@googlegroups.com
It seems to be fixed. I am not sure what revision of eden you are using. can you provide me `modules/s3/s3pdf.py` from eden directory.

--
Shiv Deepak

Shiv Deepak

unread,
Jun 29, 2011, 1:49:26 PM6/29/11
to sahan...@googlegroups.com
Ahh. It is because of weird exception handling present in s3pdf.py , Install reportlab ( http://pypi.python.org/pypi/reportlab ), this should solve your problem. :-)

--
Shiv Deepak

kasun perera

unread,
Jun 29, 2011, 2:17:43 PM6/29/11
to sahan...@googlegroups.com
Thanks Shiv, I installed reportlab. but now I run the sahana it prints this message to web page

Please edit models/000_config.py first

can you let me know what I have to edit there

Thanks again

 

kasun perera

unread,
Jun 29, 2011, 2:20:51 PM6/29/11
to sahan...@googlegroups.com
I have edited database settings as follows do I have to edit anything else?
# Database settings
deployment_settings.database.db_type = "mysql"
deployment_settings.database.host = "localhost"
deployment_settings.database.port = None # use default
deployment_settings.database.database = "sahana"
deployment_settings.database.username = "root"
deployment_settings.database.password = "password"
deployment_settings.database.pool_size = 30

Abhishek Mishra

unread,
Jun 29, 2011, 2:33:01 PM6/29/11
to sahan...@googlegroups.com
Also change this boolean to True once you've finished editing the config -

# Remind admin to edit this file
FINISHED_EDITING_CONFIG_FILE = False # change to True after you finish editing this file

--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sahana-eden/-/sWheW8kha28J.

Pat Tressel

unread,
Jun 29, 2011, 6:53:42 PM6/29/11
to sahan...@googlegroups.com
Kasun --


Is this just for development on your local machine, and you are not allowing network connections to the database?  (That's a choice during MySQL installation.)  If this is a server, or if you are allowing network connections to MySQL, it would be good to choose a better password.

-- Pat

kasun perera

unread,
Jun 29, 2011, 9:36:00 PM6/29/11
to sahan...@googlegroups.com
Hi now it gives the following error-  Cannot connect to mysql Database: scdmc@localhost:3306/sahana

I run follwing commands to connect through, but I can't connect to mysql

kasun@kasun-Vostro-1520:~$ sudo mysqladmin -h `hostname` --port=3306 version
mysqladmin: connect to server at 'kasun-Vostro-1520' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'
kasun@kasun-Vostro-1520:~$ service mysql status
mysql start/running, process 1127

I google this error but couldn't find anything usefull, do you have a Idea how to solve this issue?
thank you 


graeme

unread,
Jun 29, 2011, 9:46:32 PM6/29/11
to sahan...@googlegroups.com
Greetings Kasun,

Welcome to Sahana-Eden and sorry that your first experience was this error. As others have pointed out this only occurs if ReportLabs has not been installed, I thought that I had fixed it but no. So thank you for highlighting this problem and I hope that it doesn't put you off from making more contributions and making Sahana-Eden an even better product.

Shiv: you said... "Moving class S3PDFOCRForm from class S3PDF and making it a separate class seems to solve this problem." That was the situation when this error first occurred which was why I moved it to where I did believing, erroneously, that the class S3PDF would protect it. It doesn't and so we need to wrap proper guards around it. By all means you can put it as a separate class again but try putting it inside of an if reportLabImported: conditional. I hope that will work and if you can alert others when you are ready to merge so that it can be critiqued by many eyes.

Regards,

Graeme.

kasun perera

unread,
Jun 29, 2011, 10:39:19 PM6/29/11
to sahan...@googlegroups.com
Hi now i'm getting this error- Cannot connect to mysql Database: scdmc@localhost:3306/sahana

I tried with this commands, it seems a problem with mysql

 
kasun@kasun-Vostro-1520:~$ sudo mysqladmin -h `hostname` --port=3306 version
mysqladmin: connect to server at 'kasun-Vostro-1520' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'
kasun@kasun-Vostro-1520:~$ service mysql status
mysql start/running, process 1127

I google this matter but couldn't find any useful solution, does anyone have a idea of how to solve this issue?
thank you 

Shiv Deepak

unread,
Jun 30, 2011, 1:25:41 AM6/30/11
to sahan...@googlegroups.com
Hi Graeme,
  Yes, that will solve the problem. thanks :-)

--
Shiv Deepak


--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.

Shiv Deepak

unread,
Jun 30, 2011, 2:24:39 AM6/30/11
to sahan...@googlegroups.com
Resolved and pushed to my branch :-)

--
Shiv Deepak


On Thu, Jun 30, 2011 at 7:16 AM, graeme <foster...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.

Fran Boon

unread,
Jun 30, 2011, 3:31:11 AM6/30/11
to sahan...@googlegroups.com
On 30 June 2011 03:39, kasun perera <kkasun...@gmail.com> wrote:
> Hi now i'm getting this error- Cannot connect to mysql Database:
> scdmc@localhost:3306/sahana
> I tried with this commands, it seems a problem with mysql
> kasun@kasun-Vostro-1520:~$ sudo mysqladmin -h `hostname` --port=3306 version
> mysqladmin: connect to server at 'kasun-Vostro-1520' failed
> error: 'Lost connection to MySQL server at 'reading initial communication
> packet', system error: 111'
> kasun@kasun-Vostro-1520:~$ service mysql status
> mysql start/running, process 1127

I suspect that MySQL is only listening to localhost. this can be shown via:
netstat -antpu | grep 3306

If you need access from non-localhost (which you probably don't) then:
http://lists.mysql.com/mysql/209516

There may be an OS-dependent method too...

F

kasun perera

unread,
Jun 30, 2011, 3:40:50 AM6/30/11
to sahan...@googlegroups.com, idle...@gmail.com
hi Shive 

i'm getting this error,- Cannot connect to mysql Database: localhost:3306/sahana
my database is up and running, I couldn't find a solutions,my database setting are as follows.

# Database settings
deployment_settings.database.db_type = "mysql"
deployment_settings.database.host = "localhost"
deployment_settings.database.port = None # use default
deployment_settings.database.database = "sahana"
deployment_settings.database.username = "root"
deployment_settings.database.password = "root"
deployment_settings.database.pool_size = 30


pls let me know ho do i proceed
--
Regards

Kasun Dileepa Perera
Department of Computer Science and Engineering
University Of Moratuwa

Pat Tressel

unread,
Jun 30, 2011, 4:39:17 AM6/30/11
to sahan...@googlegroups.com
Kasun --

I'm assuming this is a Linux system -- if it isn't please tell us what it is.

kasun@kasun-Vostro-1520:~$ sudo mysqladmin -h `hostname` --port=3306 version

Are you doing this command on the same system where MySQL is running (which is implied by use of `hostname`)?  If so, you do not need to specify the hostname.  Is there a reason for using a specific port?

Also, you do not need to run as root.  MySQL does not care what Linux username you're logged in as -- it only cares if you know its own passwords and users.  If the database was correctly created with a MySQL root user and password, and you know that password, then you should be able to connect to the database like this:

mysql --user=root --password

This will prompt you for the password -- you should enter the MySQL root password that was set during installation of MySQL.

Note the MySQL root user and password are *not* the same as the MySQL user granted access to a particular database.  Those other MySQL users and their privileges are set after each database is created by the "grant" command.

So first try connecting to MySQL as above, using the MySQL root user (which, again, is *not* the Linux root user).  Let us know if it allows you to connect.

-- Pat

kasun perera

unread,
Jun 30, 2011, 7:24:11 AM6/30/11
to sahan...@googlegroups.com
Hi Pat
thanks for your reply, yes its ubuntu 10.10, It works fine with the sqlite database, but when i change the configuration to mysql it gives this error

Cannot connect to mysql Database: scdmc@localhost:3306/sahana

Mysql works fine here is the output, and below contain my 000_config.py file settings.
kasun@kasun-Vostro-1520:~$ mysql --user=root --password=ff@scdmc
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.1.49-1ubuntu8.1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| phpmyadmin         |
| sahana             |
+--------------------+
4 rows in set (0.00 sec)




# Database settings
deployment_settings.database.db_type = "mysql"
deployment_settings.database.host = "localhost"
deployment_settings.database.port = None # use default
deployment_settings.database.database = "sahana"
deployment_settings.database.username = "root"
deployment_settings.database.password = "ff@scdmc"
deployment_settings.database.pool_size = 30


Thank you

--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.
To post to this group, send email to sahan...@googlegroups.com.
To unsubscribe from this group, send email to sahana-eden...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sahana-eden?hl=en.

Fran Boon

unread,
Jun 30, 2011, 8:01:01 AM6/30/11
to sahan...@googlegroups.com
On 30 June 2011 12:24, kasun perera <kkasun...@gmail.com> wrote:
> deployment_settings.database.password = "ff@scdmc"

http://eden.sahanafoundation.org/ticket/726

F

Pat Tressel

unread,
Jul 1, 2011, 12:09:48 AM7/1/11
to sahan...@googlegroups.com
On 30 June 2011 12:24, kasun perera <kkasun...@gmail.com> wrote:
> deployment_settings.database.password = "ff@scdmc"

Aha!  So the password isn't "password" or "root".  ;-)  And it has a funny character in it...
 

So the easy fix is to change the password to something without an @ in it, or other characters web2py doesn't like.

-- Pat

graeme

unread,
Jul 1, 2011, 1:26:19 AM7/1/11
to sahan...@googlegroups.com
Maybe a comment in 000_config would be helpful to help avoid this problem in the future.

On 30 June 2011 12:24, kasun perera <kkasun...@gmail.com> wrote:
> deployment_settings.database.password = "ff@scdmc"

http://eden.sahanafoundation.org/ticket/726


Graeme. 

Fran Boon

unread,
Jul 1, 2011, 3:04:15 AM7/1/11
to sahan...@googlegroups.com
On 1 July 2011 06:26, graeme <foster...@gmail.com> wrote:
>> http://eden.sahanafoundation.org/ticket/726

> Maybe a comment in 000_config would be helpful to help avoid this problem in
> the future.

Done :)

F

kasun perera

unread,
Jul 1, 2011, 1:13:42 PM7/1/11
to sahan...@googlegroups.com
Its not finish I still get the same error-Cannot connect to mysql Database: localhost:3306/sahana
here is my new 000_config.py database settings


deployment_settings.database.db_type = "mysql"
deployment_settings.database.host = "localhost"
deployment_settings.database.port = None # use default
deployment_settings.database.database = "sahana"
deployment_settings.database.username = "root"
deployment_settings.database.password = "kasun"
deployment_settings.database.pool_size = 30

& connection to the mysql db

kasun@kasun-Vostro-1520:~$ mysql --user=root --password=kasun

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 63

Server version: 5.1.49-1ubuntu8.1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| phpmyadmin         |
| sahana             |
+--------------------+
4 rows in set (0.00 sec)

mysql>

--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.
To post to this group, send email to sahan...@googlegroups.com.
To unsubscribe from this group, send email to sahana-eden...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sahana-eden?hl=en.

32E.png

Fran Boon

unread,
Jul 1, 2011, 1:41:06 PM7/1/11
to sahan...@googlegroups.com
On 1 July 2011 18:13, kasun perera <kkasun...@gmail.com> wrote:
Its not finish I still get the same error-Cannot connect to mysql Database: localhost:3306/sahana
here is my new 000_config.py database settings
deployment_settings.database.db_type = "mysql"
deployment_settings.database.host = "localhost"
deployment_settings.database.port = None # use default
deployment_settings.database.database = "sahana"
deployment_settings.database.username = "root"
deployment_settings.database.password = "kasun"
kasun@kasun-Vostro-1520:~$ mysql --user=root --password=kasun

Check also with:
mysql -h localhost --user=root --password=kasun
 
There can be different accesses depending on exactly how you connect to the DB.

Also, what user are you running Web2Py as?
Make sure that user can write to the ~web2py folder
- I just got hit by this issue on another server & giving it ownership of that folder allowed it to work...

F
32E.png

Dominic König

unread,
Jul 1, 2011, 1:51:36 PM7/1/11
to sahan...@googlegroups.com
Hmm,

you probably need to

$ sudo apt-get install python-mysqldb

or

$ sudo apt-get install pymysql

When you startup the web2py server, it will show you the available DB drivers
for mysql, so the startup message of web2py would be of interest here.

Dominic

fredagen den 1 juli 2011 19.13.42 skrev kasun perera:
> Its not finish [?]I still get the same error-Cannot connect to mysql

signature.asc

Fran Boon

unread,
Jul 1, 2011, 1:55:38 PM7/1/11
to sahan...@googlegroups.com
2011/7/1 Dominic König <dom...@nursix.org>:

> you probably need to
> $ sudo apt-get install python-mysqldb

Whilst advisable for Production reliability, this shouldn't actually
be necessary

> $ sudo apt-get install pymysql

This is included in gluon/contrib so doesn't need installing int he
system Python.

F

Dominic König

unread,
Jul 1, 2011, 2:09:50 PM7/1/11
to sahan...@googlegroups.com
Yes I know,

but else this is a pure permission problem.

As a trial, I'd recommend to do a

mysql> GRANT ALL ON sahana.* TO sahana@localhost IDENTIFIED by 'password';

and change the DB username in 000_config.py from "root" into "sahana", and the
DB password into "password", as in:

deployment_settings.database.db_type = "mysql"
deployment_settings.database.host = "localhost"
deployment_settings.database.port = None # use default
deployment_settings.database.database = "sahana"

deployment_settings.database.username = "sahana"


deployment_settings.database.password = "password"
deployment_settings.database.pool_size = 30

If that does not work for you, then the DB setup is wrong, somehow.

Dominic

signature.asc

Pat Tressel

unread,
Jul 1, 2011, 5:36:56 PM7/1/11
to sahan...@googlegroups.com
Kasun --

Since you're using a different password now, you need to give that user and new password permission to access the database, as Dominic said, by doing a grant command.  We know that you have access with the root user, so start there:

mysql --user=root --password=kasun

Then do the grant command Dominic gave.

GRANT ALL ON sahana.* TO sahana@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

(The commands are not case-sensitive -- it's just easier to see which words are commands and which are data if we put the commands in uppercase.)

After that, check that the sahana user can access the database with mysql.  (Exit from mysql or use a different shell for this.)

mysql --user=sahana --password=password sahana

Try a command that just reads data, like:

SHOW TABLES;

If that works, we can try something safe that alters the database, like a create table and drop table on some unused table name.

-- Pat

kasun perera

unread,
Jul 2, 2011, 2:29:08 AM7/2/11
to sahan...@googlegroups.com
Still I couldn't resolve the error

my SQl command outputs

$mysql --user=sahana --password=password password
mysql> USE sahana;
Database changed
mysql> SHOW TABLES;
Empty set (0.00 sec)

mysql> CREATE TABLE `sahana`.`id` (
    -> `id` INT NOT NULL
    -> ) ENGINE = MYISAM ;
Query OK, 0 rows affected (0.08 sec)

mysql> CREATE TABLE `sahana`.`incident` ( `id` INT NOT NULL ) ENGINE = MYISAM;
Query OK, 0 rows affected (0.07 sec)

mysql> drop table sahana.id;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW TABLES;
+------------------+
| Tables_in_sahana |
+------------------+
| incident         |
+------------------+
1 row in set (0.00 sec)

mysql>

my File permition for webpy folder is this hope its ok-
drwxr-xr-x 10 kasun kasun     4096 2011-07-02 10:19 web2py

when I run the web2py it gives foowing output
kasun@kasun-Vostro-1520:~/web2py$ python web2py.py
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011

Version 1.92.1 (2011-03-01 09:16:48)
Database drivers available: SQLite3, pymysql, CouchDB
Starting hardcron...
please visit:
    http://127.0.0.1:8000
starting browser...

but when I run eden it will give the error Cannot connect to mysql Database: localhost:3306/sahana
And in command propmt it prints
S3 Debug: s3task: Celery not installed or Configured, Tasks will run Synchronously.

but I have already installed celery-2.2.7

Is this the prob then how to configure celery?

--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.
To post to this group, send email to sahan...@googlegroups.com.
To unsubscribe from this group, send email to sahana-eden...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sahana-eden?hl=en.

graeme

unread,
Jul 2, 2011, 3:55:31 AM7/2/11
to sahan...@googlegroups.com
Kasun,

If you can log on to IRC it might be easier to help debug this with you.

It looks like your user sahana is set up with the right permissions so:
What are your current settings on models/000_config.py?

I don't think that you need to worry about celery.

Graeme.

Pat Tressel

unread,
Jul 2, 2011, 3:56:56 AM7/2/11
to sahan...@googlegroups.com
Kasun --

$mysql --user=sahana --password=password password
mysql> USE sahana;

Ok, so the database is accessible with that user and password -- good.

my File permition for webpy folder is this hope its ok-
drwxr-xr-x 10 kasun kasun     4096 2011-07-02 10:19 web2py

The file permissions on the web2py directory (and subdirectories) won't affect use of MySQL, though they could cause other problems for web2py, since it writes there.  But if you're running under username kasun, this should be ok.
 
when I run the web2py it gives foowing output
kasun@kasun-Vostro-1520:~/web2py$ python web2py.py
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011

Version 1.92.1 (2011-03-01 09:16:48)
Database drivers available: SQLite3, pymysql, CouchDB
Starting hardcron...
please visit:
    http://127.0.0.1:8000
starting browser...

but when I run eden it will give the error Cannot connect to mysql Database: localhost:3306/sahana
And in command propmt it prints
S3 Debug: s3task: Celery not installed or Configured, Tasks will run Synchronously.

but I have already installed celery-2.2.7

Is this the prob then how to configure celery?

No, celery isn't relevant.  That's not an error, just information.

But we've seen about 4 different versions of the database connection info in 000_config ;-) so please make sure that what's in there now actually matches the database name, user, and password you just tried above.

Also, delete the test tables you made above, so the sahana database is empty.  Then delete everything in your web2py/applications/eden/databases directory, so web2py will start over with a fresh database.  If that doesn't work, we may need to get more info about the actual error.

Are you set up to use eclipse?

-- Pat

Pat Tressel

unread,
Jul 2, 2011, 4:02:35 AM7/2/11
to sahan...@googlegroups.com
Just to be clear...

Also, delete the test tables you made above, so the sahana database is empty.  Then delete everything in your web2py/applications/eden/databases directory, so web2py will start over with a fresh database.  If that doesn't work...

After verifying that the database name, user, and password in 000_config are the same as what you used with the mysql command, and after clearing out the test tables and deleting files in the databases directory, try starting web2py and accessing eden again.

Are you starting web2py without starting the GUI?  If not, you might try that -- it may be easier to see the errors that way.  Assuming your directories are web2py/applications/eden, then try:

cd web2py
python web2py.py -N -M -S eden

-- Pat

Fran Boon

unread,
Jul 2, 2011, 5:05:40 AM7/2/11
to sahan...@googlegroups.com
On 2 July 2011 07:29, kasun perera <kkasun...@gmail.com> wrote:
> Still I couldn't resolve the error
> my SQl command outputs
> $mysql --user=sahana --password=password password

I've not yet seen you try:

mysql -h localhost --user=sahana --password=password

F

kasun perera

unread,
Jul 2, 2011, 5:19:56 AM7/2/11
to sahan...@googlegroups.com
sorry Fran here it is

kasun@kasun-Vostro-1520:~$ mysql -h localhost --user=sahana --password=password

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 45

Server version: 5.1.49-1ubuntu8.1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| phpmyadmin         |
| sahana             |
+--------------------+
4 rows in set (0.00 sec)

mysql>



F

--
You received this message because you are subscribed to the Google Groups "Sahana-Eden" group.
To post to this group, send email to sahan...@googlegroups.com.
To unsubscribe from this group, send email to sahana-eden...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sahana-eden?hl=en.

Pat Tressel

unread,
Jul 2, 2011, 3:44:41 PM7/2/11
to sahan...@googlegroups.com
Kasun --

Graeme had a good suggestion -- we could get this straightened out faster if we use IRC to chat in real time, rather than waiting for email.

If you don't have an IRC client, go to http://webchat.freenode.net and join channel #sahana-eden.  If you haven't used IRC before, just type messages in the text box at the bottom of the page, type enter, and they'll be posted in the chat.

The next question we want to check is:  Are the database name, user, and password in 000_config.py the same as the ones you used with the mysql command?

Some basic questions:

-- Are you running this on your own machine?  Is is always the same machine, or do you have, say, a laptop and a desktop, and you're using one or the other?  (The point of this question is to find out if you're always talking to the same MySQL installation.)

-- Or, are you using a school machine?  If so, when you connect to the school machine, do you always get the same machine, or do you get a random machine?  (The point of this question is to find out if the school machines are on a DNS rotator, and if you're getting a different MySQL server some of the time.  Also want to find out if the sysadmins wipe the MySQL databases on occasion.  And want to rule out the possibility that there are multiple web2py installations on different local filesystems.)

-- What is the operating system?  (This will help us locate MySQL log files and let us give you appropriate commands to try.)

But come to IRC on freenode so we can discuss this!

-- Pat

Fran --

> my SQl command outputs
> $mysql --user=sahana --password=password password

I've not yet seen you try:

mysql -h localhost --user=sahana --password=password

We've gotten past that stage -- Kasun provided output from the mysql command earlier in the thread.  We're now at the point of making sure the database parameters in 000_config are the same as the ones Kasun successfully used with the mysql command.

Once we're sure those match, if eden still does not start, and if there isn't some weirdness with getting different MySQL installations or even different filesystems, I'm recommending using eclipse to stop at the actual point of connecting to the database, in hope of getting a more precise error.

-- Pat

Pat Tressel

unread,
Jul 2, 2011, 8:16:03 PM7/2/11
to sahan...@googlegroups.com
Hold the presses!

Praneeth hit the same issue, and tracked it to a bug in Eden.

On line 64 of models/00_db.py, change importError to ImportError.

Great catch by Praneeth!

-- Pat

graeme

unread,
Jul 2, 2011, 10:28:46 PM7/2/11
to sahan...@googlegroups.com
Good catch.

So this is an example of the naked excepts that Mike was referring to in a earlier email. There was mention of removing these but would it be possible (easier) to add a logger to these so that additional information is captured in the except block written to a log file and then processing continues as before. If we had something like that then it might be possible to find out what the true exception was. Or do we go through and try and wok out what the exception should be (in this case a RuntimeError) catch what we are expecting and get a ticket for anything unexpected, or have another naked except swallow it up.

Graeme.

graeme

unread,
Jul 2, 2011, 10:35:50 PM7/2/11
to sahan...@googlegroups.com
So this is an example of the naked excepts that Mike was referring to in a earlier email. 

I think that it might have been an IRC conversation which I can'r locate but he added it here: http://eden.sahanafoundation.org/wiki/DeveloperGuidelinesCodeConventions#Exceptions 

Graeme.

Fran Boon

unread,
Jul 3, 2011, 3:05:48 AM7/3/11
to sahan...@googlegroups.com
On 3 July 2011 03:28, graeme <foster...@gmail.com> wrote:
> Good catch.

& fixed now :)
Thanks lifeeth!

> So this is an example of the naked excepts that Mike was referring to

No, this is actually the opposite - the exception tries to be handled
properly, but actually causes more problems in so doing since it
itself had a problem too!

I guess I never triggered this before as, when not using pgsql, I
always use MySQLdb as the driver & this would only trigger if trying
to fallback to pymysql...

F

graeme

unread,
Jul 3, 2011, 3:56:43 AM7/3/11
to sahan...@googlegroups.com
 So this is an example of the naked excepts that Mike was referring to

No, this is actually the opposite - the exception tries to be handled
properly, but actually causes more problems in so doing since it
itself had a problem too!

Sorry I probably was very clear but I was referring to the except that does catch the problem on line 75

Reply all
Reply to author
Forward
0 new messages