Modify

Opened 3 years ago

Closed 2 years ago

#9729 closed defect (fixed)

OperationalError: no such table: smp_project

Reported by: nancyshipley@… Owned by: 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 (2)

load_db.sql (656 bytes) - added by crossroad 2 years ago.
To set starting SQL database plugin
error.png (20.6 KB) - added by crossroad 2 years ago.
Error

Download all attachments as: .zip

Change History (12)

comment:1 Changed 3 years ago by crossroad

  • Status changed from new to assigned

comment:2 Changed 3 years ago 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

comment:3 Changed 3 years ago by nancyshipley@…

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

comment:4 Changed 3 years ago 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

comment:5 Changed 2 years ago 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

Changed 2 years ago by crossroad

To set starting SQL database plugin

Changed 2 years ago by crossroad

Error

comment:6 follow-up: Changed 2 years ago 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".
  1. 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

comment:7 in reply to: ↑ 6 Changed 2 years ago 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"

comment:8 follow-up: Changed 2 years ago by nancyshipley@…

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!

comment:9 in reply to: ↑ 8 Changed 2 years ago 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]"

comment:10 Changed 2 years ago by nancyshipley@…

  • Resolution set to fixed
  • Status changed from assigned to closed

Awesome! That worked. Thanks so much!

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from crossroad. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.