Wrowser´ Testing

Asked by kharny

Hello,
i´ve jsut installed the Openwns and the postgreSQL. Now i´m about to test
it by going step by step through the tutorial-pages:
http://docs.openwns.org/usersGuide/modules/dll/wifimac/experiment1.html

Unfortunelly i´ve got some problems to execute the "exemple1" using the schell windows.

Directory: /myFirstCampaign/experiment1
after entering: cp
../../myOpenWNS/tests/system/wifimac-tests/PyConfig/experiment1/campaignConfiguration.py
.
----------------------------------

" ./simcontrol.py --create-database " generated following infomations:

Traceback (most recent call last):
  File "./campaignConfiguration.py", line 50, in <module>
    from pywns.simdb.Parameters import Parameters, Bool, Int, Float, String
ImportError: No module named pywns.simdb.Parameters
Database entries successfully created.
----------------------------------

" ./simcontrol.py --create-scenarios " generated following infomations:
Traceback (most recent call last):
  File "./simcontrol.py", line 630, in <module>
    queue.run()
  File "./simcontrol.py", line 486, in run
    command(arg)
  File "./simcontrol.py", line 66, in createScenarios
    cursor.execute('SELECT id FROM scenarios WHERE campaign_id = %d' %
config.campaignId)
AttributeError: 'Configuration' object has no attribute 'campaignId'
----------------------------------

" ./simcontrol.py -i " generated following infomations:
Traceback (most recent call last):
  File "./simcontrol.py", line 630, in <module>
    queue.run()
  File "./simcontrol.py", line 486, in run
    command(arg)
  File "./simcontrol.py", line 372, in jobInfo
    consistencyCheck()
  File "./simcontrol.py", line 326, in consistencyCheck
    cursor.execute('SELECT id, current_job_id, state FROM scenarios WHERE
campaign_id = %d AND current_job_id != 0' % config.campaignId)
AttributeError: 'Configuration' object has no attribute 'campaignId'

-----------------------------------

I also tried to test "experiment3" but had quite the same error informations.
Would you please help me out?
Thank you

Question information

Language:
English Edit question
Status:
Answered
For:
openWNS WiFiMAC Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sebastian Max (smx-comnets) said :
#1

Hi,

Mmm... the problem is the following error output when you call './simcontrol.py --create-database':

  File "./campaignConfiguration.py", line 50, in <module>
    from pywns.simdb.Parameters import Parameters, Bool, Int, Float, String
ImportError: No module named pywns.simdb.Parameters

Could you try to change the 'pywns.simdb.Parameters' to 'wrowser.simdb.Parameters' in the file 'campaignConfiguration.py' (line 50). If you have set the python-path to the wrowser correctly (see http://docs.openwns.org/usersGuide/gettingStarted/wrowser.html#adding-the-wrowser-plugin-into-playground-py), the module should be found.

Please give me feedback if that has worked for you!

BR,
Sebastian

Revision history for this message
kharny (kharny) said :
#2

Hi Sebastian. Thanks for hint.
Unfortunelly, it still doesnt work. I tried to reinstall the preparecampaign and think the problem might be there, cause i got the following error informations
-------------------------------
~/myOpenWNS# ./playground.py preparecampaign ../myFirstCampaign
Preparing simulation campaign. Please wait...
Do you want to use the database server for storing simulation campaign related data? (y/N) y
Please enter the name of the directory the simulations shall be stored in [simulations]: experiment1
Please enter a name for the campaign: camCheck
Please enter a short description of the campaign: testIt
Traceback (most recent call last):
  File "./playground.py", line 104, in <module>
    core.run()
  File "/home/studi/myOpenWNS/wnsbase/playground/Core.py", line 187, in run
    self.command.run()
  File "/home/studi/myOpenWNS/wrowser/wrowser/playgroundPlugins/SimulationCampaign/__init__.py", line 229, in run
    PrepareCampaign.createNewSubCampaign(directory)
  File "/home/studi/myOpenWNS/wrowser/wrowser/playgroundPlugins/SimulationCampaign/PrepareCampaign.py", line 91, in createNewSubCampaign
    cursor.execute('INSERT INTO campaigns (title, description) VALUES (\'%s\', \'%s\')' % (campaignTitle, campaignDescription))
psycopg2.IntegrityError: NULL-Wert in Spalte »id« verletzt Not-Null-Constraint
--------------------------------------------------------

Any ideas?
Thanks
kharny

Revision history for this message
kharny (kharny) said :
#3

Hi Sebastian. Thanks for hint.
Unfortunelly, it still doesnt work. I tried to reinstall the preparecampaign and think the problem might be there, cause i got the following error informations
-------------------------------
~/myOpenWNS# ./playground.py preparecampaign ../myFirstCampaign
Preparing simulation campaign. Please wait...
Do you want to use the database server for storing simulation campaign related data? (y/N) y
Please enter the name of the directory the simulations shall be stored in [simulations]: experiment1
Please enter a name for the campaign: camCheck
Please enter a short description of the campaign: testIt
Traceback (most recent call last):
  File "./playground.py", line 104, in <module>
    core.run()
  File "/home/studi/myOpenWNS/wnsbase/playground/Core.py", line 187, in run
    self.command.run()
  File "/home/studi/myOpenWNS/wrowser/wrowser/playgroundPlugins/SimulationCampaign/__init__.py", line 229, in run
    PrepareCampaign.createNewSubCampaign(directory)
  File "/home/studi/myOpenWNS/wrowser/wrowser/playgroundPlugins/SimulationCampaign/PrepareCampaign.py", line 91, in createNewSubCampaign
    cursor.execute('INSERT INTO campaigns (title, description) VALUES (\'%s\', \'%s\')' % (campaignTitle, campaignDescription))
psycopg2.IntegrityError: NULL-Wert in Spalte »id« verletzt Not-Null-Constraint
--------------------------------------------------------

Any ideas?
Thanks
kharny

Revision history for this message
Sebastian Max (smx-comnets) said :
#4

If you haven't done it yet: could you try to reinstall into a new directory (also with an unused campaign name). E.g.

~/myOpenWNS# ./playground.py preparecampaign ../testCampaign
Preparing simulation campaign. Please wait...
Do you want to use the database server for storing simulation campaign related data? (y/N) y
Please enter the name of the directory the simulations shall be stored in [simulations]: experiment1
Please enter a name for the campaign: testCampaign
Please enter a short description of the campaign: testIt

Apparently, at the first installation this error did not come up, hence my suggestion.

Revision history for this message
kharny (kharny) said :
#5

Hello Sebastian,
just tried it like you proposed. There are unfortunelly no changes.
I got the same error informations the very first time i started the preparecampaign-installation but just ignored it caused the directories were created anyway.
That means, from day one the first error message was the same as in my last mail:

-------------------------------
~/myOpenWNS# ./playground.py preparecampaign ../myFirstCampaign
Preparing simulation campaign. Please wait...
Do you want to use the database server for storing simulation campaign related data? (y/N) y
Please enter the name of the directory the simulations shall be stored in [simulations]: experiment1
Please enter a name for the campaign: camCheck
Please enter a short description of the campaign: testIt
Traceback (most recent call last):
  File "./playground.py", line 104, in <module>
    core.run()
  File "/home/studi/myOpenWNS/wnsbase/playground/Core.py", line 187, in run
    self.command.run()
  File "/home/studi/myOpenWNS/wrowser/wrowser/playgroundPlugins/SimulationCampaign/__init__.py", line 229, in run
    PrepareCampaign.createNewSubCampaign(directory)
  File "/home/studi/myOpenWNS/wrowser/wrowser/playgroundPlugins/SimulationCampaign/PrepareCampaign.py", line 91, in createNewSubCampaign
    cursor.execute('INSERT INTO campaigns (title, description) VALUES (\'%s\', \'%s\')' % (campaignTitle, campaignDescription))
psycopg2.IntegrityError: NULL-Wert in Spalte »id« verletzt Not-Null-Constraint
--------------------------------------------------------

I don t know, if it important to mention it, but... " ./playground.py runtests "
work properly even if there were 2 warnings:

Test phase:
.....................................................................
**********************************************************************

**********************************************************************
SystemTestSuite: .../myOpenWNS/tests/system/wimac-tests/configSubframe
Configuration: config.py
Description: WiMAC: Relay enhanced cell
----------------------------------------------------------------------
Suite is disabled: pending reconfiguration of the compound switch
Disabled.
**********************************************************************

**********************************************************************
SystemTestSuite: ...OpenWNS/tests/system/wimac-tests/configSubframeTDD
Configuration: config.py
Description: WiMAC: Relay enhanced cell
----------------------------------------------------------------------
Suite is disabled: Pending migration to openwns.evaluation
Disabled.
**********************************************************************
----------------------------------------------------------------------
Ran 2097 tests in 389.777s

OK
Warning: You had 2 suites disabled.

         TestSuite:
/home/studi/myOpenWNS/tests/system/wimac-tests/configSubframe
         Reason: pending reconfiguration of the compound switch

         TestSuite:
/home/studi/myOpenWNS/tests/system/wimac-tests/configSubframeTDD
         Reason: Pending migration to openwns.evaluation

--------------------------------------------------------------------------------------------------------------

Thanks

Revision history for this message
Sebastian Max (smx-comnets) said :
#6

Hi,

I have just spoken to our database expert.

First of all, the two warnings in the system test have nothing to do with the reported error - you can safely ignore them.

The problem is definitely related to the database - either in the postgresql itself or the initialization of the database in the prerequisites section.
First of all, could you tell us the version of your postgresql? We are using version 8.2, 8.1 should also work.

BR,
Sebastian

Revision history for this message
kharny (kharny) said :
#7

Hi,
i´m using the psql (PostgreSQL) 8.3.7
BR
kharny

Revision history for this message
Sebastian Max (smx-comnets) said :
#8

Hi,

yes, this might be the problem. As said before, we have developed the database frontend using psql 8.1 and are currently using 8.2. Testing for 8.3 did not take place (yet).

Apparently, the generation of the IDs does not work in the same way for 8.2 and 8.3. This generation is a little bit tricky here, as we are using derived tables that have one id generator to ensure that in the merge of the tables no two campaigns have the same id. This is e.g. important if multiple users use the database (but also in many other different places). Hence, we have written our own id generator - which does apparently not work in 8.3.

The only fast solution that I can currently think of is a re-installation of your database, using psql 8.2.

BR,
Sebastian

Revision history for this message
kharny (kharny) said :
#9

Hello,
since the last time, I´ve replaced psql8.3 with psql8.2. I´m not able to connect to the database anymore. Since then I always got the following error messages:

~/wrowser/wrowser/simdb/scripts# ./createUser.py
Please enter the password of the 'postgres' super user:
Traceback (most recent call last):
  File "./createUser.py", line 54, in <module>
    db.Database.connect(dbName, hostname, 'postgres', postgresPassword)
  File "/home/studi/wrowser/wrowser/simdb/Database.py", line 54, in connect
    password = password)
psycopg2.OperationalError: could not connect to server: Connection refused
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5432?

Can anybody help me out?
Thanks
BR
kharny

Revision history for this message
Daniel Bültmann (daniel.bueltmann) said :
#10

Dear kharny,

psycopg2 suggests that you check if the server is running on localhost
and is listening on port 5432.
You should check if this is the case by executing

netstat -nl

This lists all listening sockets and should include the postgres server
listening on 5432. If there is no listening
socket for port 5432, it could either mean that the server is not
running, or it could mean that the server is listening
on a different port. In the first case you could try to do something like

/etc/init.d/postgres status

and check if the server is running. In the second case you need to check
the config files of your database server.

Regards,
  Daniel

kharny wrote:
> Question #74899 on openWNS WiFiMAC changed:
> https://answers.launchpad.net/openwns-wifimac/+question/74899
>
> Status: Answered => Open
>
> kharny is still having a problem:
> Hello,
> since the last time, I´ve replaced psql8.3 with psql8.2. I´m not able to connect to the database anymore. Since then I always got the following error messages:
>
> ~/wrowser/wrowser/simdb/scripts# ./createUser.py
> Please enter the password of the 'postgres' super user:
> Traceback (most recent call last):
> File "./createUser.py", line 54, in <module>
> db.Database.connect(dbName, hostname, 'postgres', postgresPassword)
> File "/home/studi/wrowser/wrowser/simdb/Database.py", line 54, in connect
> password = password)
> psycopg2.OperationalError: could not connect to server: Connection refused
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5432?
>
> Can anybody help me out?
> Thanks
> BR
> kharny
>
>

Revision history for this message
kharny (kharny) said :
#11

Hallo Daniel,
thanks for your help. You were right. After reinstalling psql8.2.7 the server started to listen on port 5433. I could fix it and have reload the database. Unfortunelly i´ve got the error message, that forced to switch from psql8.3.7 to psql8.2.7. Please take a look at the last line:

---------------------------------------------------------------

root@kelvin:~/myOpenWNS# ./playground.py preparecampaign ../myFirstCampaign
Preparing simulation campaign. Please wait...
Do you want to use the database server for storing simulation campaign
related data? (y/N) y
Please enter the name of the directory the simulations shall be stored in
[simulations]: experiment1
Please enter a name for the campaign: checkIt
Please enter a short description of the campaign: testIt
Traceback (most recent call last):
  File "./playground.py", line 104, in <module>
    core.run()
  File "/home/studi/myOpenWNS/wnsbase/playground/Core.py", line 187, in run
    self.command.run()
  File
"/home/studi/wrowser/wrowser/playgroundPlugins/SimulationCampaign/__init__.py",
line 229, in run
    PrepareCampaign.createNewSubCampaign(directory)
  File
"/home/studi/wrowser/wrowser/playgroundPlugins/SimulationCampaign/PrepareCampaign.py",
line 91, in createNewSubCampaign
    cursor.execute('INSERT INTO campaigns (title, description) VALUES
(\'%s\', \'%s\')' % (campaignTitle, campaignDescription))
psycopg2.IntegrityError: NULL-Wert in Spalte »id« verletzt Not-Null-Constraint

---------------------------------------------------------------

Thanks for your support
Regards
kharny

Revision history for this message
Maciej Muehleisen (mue-comnets) said :
#12

Hi,

I remember having similar strange error messages once when I tried to install it and my first hint was also that there is some problem with the Postgres Version. It turned out that I had some error when I created the Database and the User. Unfortunately I do not exactly remember what it was. I would suggest deleting the entire "simdb" database and user and creating everything again:

psql -U postgres
DROP DATABASE simdb;
DROP USER your_linux_username;
exit

if you get an error on one of those you know that something went wrong when you tried creating them

now create everything again (http://docs.openwns.org/gettingStarted/postgresql.html)

cd wrowser/simdb/sql
psql -U postgres -d simdb -f setupSimDB.sql

cd wrowser/simdb/scripts
./createUser.py

be sure last command does not throw any errors! The last version was buggy here, a fix was committed. If you get an error here type "bzr pull" in the wrowser directory to update the script. Then try ./createUser.py again.

Hope that helps.

Regards,

Mac

Revision history for this message
Hendrik (mostricht) said :
#13

Hi everybody!
I am suffering from the same error (psycopg2.IntegrityError: NULL-Wert in Spalte »id« verletzt Not-Null-Constraint) by having Postgresql 8.3 installed...

However, version 8.3 is mentioned in the installation guide as well!
See
http://docs.openwns.org/gettingStarted/postgresql.html
somewhere in the middle of the page...

Is downgrading to 8.1 or 8.2 the only passable way?

cheers
hendrik

Revision history for this message
Sebastian Max (smx-comnets) said :
#14

Hi Hendrik,

from our current knowledge, downgrading does not solve the error (at least that is my conclusion from kharny's response from the 2009-07-01)! So far, we do not have a solution (plus, we are not able to recreate the bug here). But we are working on it...

BR,
Sebastian

Revision history for this message
Hendrik (mostricht) said :
#15

Problem solved (hopefully) as described in
https://bugs.launchpad.net/openwns-wrowser/+bug/396985

Can you help with this problem?

Provide an answer of your own, or ask kharny for more information if necessary.

To post a message you must log in.