Ticket #9729 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

OperationalError: no such table: smp_project

Reported by: nancyshipley@hotmail.com Assigned to: crossroad
Priority: normal Component: SimpleMultiProjectPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

After working to install SimpleMultiProjectPlugin, clicking on the Manage project always displays the error "OperationalError: no such table: smp_project". What part of the install creates the table? How can this error be reseolved?

Attachments

load_db.sql (0.6 kB) - added by crossroad on 01/31/12 04:12:59.
To set starting SQL database plugin
error.png (20.6 kB) - added by crossroad on 01/31/12 04:13:36.
Error

Change History

01/25/12 20:47:41 changed by crossroad

  • status changed from new to assigned.

01/25/12 20:54:20 changed by crossroad

Hi Nancy,

this table should be created at the time you place an "upgrade" trac instance in which you installed the plugin.

trac-admin / path_your_instance_trac / upgrade

that would be enough to create the table above.

if you do this and the problem persists, it may be a problem with the database. Tell me more about: version, database engine and version you use.

regards

01/25/12 22:34:16 changed by nancyshipley@hotmail.com

Hi, Thanks for the quick response. We are using BitNami Trac 0.12.2 with mysql. Also, below is some is the full error.

2012-01-20 14:42:14,378 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\web\main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "build\bdist.win32\egg\trac\web\main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "build\bdist.win32\egg\trac\admin\web_ui.py", line 116, in process_request
    path_info)
  File "C:\Program Files\BitNami Trac Stack\python\lib\site-packages\simplemultiproject-0.0.1-py2.6.egg\simplemultiproject\admin.py", line 47, in render_admin_panel
    projects_rows  = self.__SmpModel.get_all_projects()
  File "C:\Program Files\BitNami Trac Stack\python\lib\site-packages\simplemultiproject-0.0.1-py2.6.egg\simplemultiproject\model.py", line 27, in get_all_projects
    cursor.execute(query)
  File "build\bdist.win32\egg\trac\db\util.py", line 66, in execute
    return self.cursor.execute(sql)
  File "build\bdist.win32\egg\trac\db\sqlite_backend.py", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "build\bdist.win32\egg\trac\db\sqlite_backend.py", line 56, in execute
    args or [])
  File "build\bdist.win32\egg\trac\db\sqlite_backend.py", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
OperationalError: no such table: smp_project

Most likely the installed failed somehow. Any help would be great!

Thanks again,

Nancy

01/25/12 23:16:22 changed by crossroad

was not tested with mysql so maybe the problem. I will investigate in detail the error to see if I can replicate.

Meanwhile, you might check the following:

- Check if the tables are created in the mysql database.
- Try using the postgres or sqlite engine to see if the problem persists.

The first thing that comes to mind is that the command: trac-admin "you path environment" upgrade tube no effect on the database. Perhaps by a problem with mysql.

Tables are created in the file environmentSetup.py. If we conclude that it is not possible to automatically load the tables maybe we should charge them manually.

attention to the error says sqlite_backend.py

I remain attentive to their responses

regards

01/30/12 21:49:12 changed by anonymous

Hi, Thanks again for your support. Yes, there must have been an issue during the install. What are the steps to re-run the environmentsetup.py? Will that install the tables manually? Thanks so much, Nancy

01/31/12 04:12:59 changed by crossroad

  • attachment load_db.sql added.

To set starting SQL database plugin

01/31/12 04:13:36 changed by crossroad

  • attachment error.png added.

Error

(follow-up: ↓ 7 ) 01/31/12 04:27:46 changed by crossroad

Hi I think I could reproduce the problem, nose and may have occurred following a normal installation. Perhaps due to the way they are installed BitNami? plugin.

To replicate the issue by performing the following:

1. Load the plugin with a new instance
2. run the command "trac-admin /path_to_instance_trac/ upgrade". This creates the tables smp_project me, smp_milestone_project and add a record to the table system trac instance.
3. Remove tables and registry in step 3.

After performing these steps, when entering the admin panel displays the following error:

OperationalError: no such table: smp_project

see figure: Error.png

This way you can replicate the problem somehow, unknown how this could happen.

This problem can be solved by trying one of two ways:

1. Restart the instance of trac and from the command line run "trac-admin /path_to_instance_trac/ upgrade".

2. If not resolved to the previous point, you might try the following:

from the command line you should try to load the tables manually by running the sentences found in the file: load_db.sql linux is performed as follows:

cd /path_to_instance_trac/
sqlite3 db/trac.db

in the sqlite shell prompt run:
read /path_to_file_sql/load_db.sql

windows should be similar

luck

Regards

(in reply to: ↑ 6 ) 01/31/12 04:32:35 changed by crossroad

Sorry the sqlite command interpreter must execute the following command:

".read /path_to_file_sql/ load_db.sql;"

attention to the point before the word "read"

(follow-up: ↓ 9 ) 02/01/12 16:22:18 changed by nancyshipley@hotmail.com

Thanks again for hanging in there!

Here is the message after running the upgrade statement.

C:\Program Files\BitNami Trac Stack\python\Scripts>trac-admin "C:\Users\DEN-Admi
n\BitNami Trac Stack projects\DEN" upgrade
SimpleMultiProject database schema version: 1 initialized.
SimpleMultiProject database schema is out of date: False
Database is up to date, no upgrade necessary.

Trying again to load the Muliple Projects - the same error above continues.

Traceback (most recent call last):

  File "build\bdist.win32\egg\trac\web\main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "build\bdist.win32\egg\trac\web\main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "build\bdist.win32\egg\trac\admin\web_ui.py", line 116, in process_request
    path_info)
  File "C:\Program Files\BitNami Trac Stack\python\lib\site-packages\simplemultiproject-0.0.1-py2.6.egg\simplemultiproject\admin.py", line 47, in render_admin_panel
    projects_rows  = self.__SmpModel.get_all_projects()
  File "C:\Program Files\BitNami Trac Stack\python\lib\site-packages\simplemultiproject-0.0.1-py2.6.egg\simplemultiproject\model.py", line 27, in get_all_projects
    cursor.execute(query)
  File "build\bdist.win32\egg\trac\db\util.py", line 66, in execute
    return self.cursor.execute(sql)
  File "build\bdist.win32\egg\trac\db\sqlite_backend.py", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "build\bdist.win32\egg\trac\db\sqlite_backend.py", line 56, in execute
    args or [])
  File "build\bdist.win32\egg\trac\db\sqlite_backend.py", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
OperationalError: no such table: smp_project

When trying to run the command .read /path_to_file_sql/ load_db.sql; There is no load_db.sql anywhere. Where can I find that file?

THANK YOU!

(in reply to: ↑ 8 ) 02/01/12 16:39:27 changed by crossroad

Replying to nancyshipley@hotmail.com:

Thanks again for hanging in there! Here is the message after running the upgrade statement. ... Database is up to date, no upgrade necessary.

According to this database should be updated, in your trac.ini file check that your trac instance points to the appropriate database.

Trying again to load the Muliple Projects - ...

sqlite then the interpreter must execute the command as follows: ". read [replace this with the full path to your file load_db.sql stored on the server]"

02/01/12 18:15:20 changed by nancyshipley@hotmail.com

  • status changed from assigned to closed.
  • resolution set to fixed.

Awesome! That worked. Thanks so much!


Add/Change #9729 (OperationalError: no such table: smp_project)




Change Properties
Action