Modify

Opened 4 years ago

Closed 5 months ago

#7481 closed defect (fixed)

plugin MindMap cause my Trac server 500 error.

Reported by: anonymous Owned by: rjollos
Priority: normal Component: MindMapMacro
Severity: normal Keywords:
Cc: theodor.norup@…, hasienda Trac Release: 0.12

Description

log is:
2010-08-12 19:32:50,897 Trac[env] WARNING: Component <tracmindmap.macro.MindMapMacro object at 0x2a9d1ff210> requires environment upgrade

i do not know why this happened, could anybody help to have a look?

Attachments (2)

t7481.diff (1.8 KB) - added by rjollos 6 months ago.
t7481.2.diff (2.5 KB) - added by rjollos 6 months ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 4 years ago by anonymous

Oops...

i find that there is a table needed be created.

sql:

CREATE TABLE mindmapcache (
    `hash` text,
    `content` text,
    PRIMARY KEY (`hash`(255))
)

comment:2 Changed 4 years ago by martin_s

  • Status changed from new to assigned

Did you tried to upgrade your database using:

  trac-admin </path/to/your/trac/installation> upgrade

The macro stores some information in the database.

If the upgrade fails, please post the output here.

comment:3 Changed 4 years ago by martin_s

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

I know tested the current version of the macro with a fresh installed Trac 0.12.
The DB table is created properly. Did you upgraded from a older version of the macro?

I'm closing this ticket now, because it works for me. Please feel free to reopen it if you still have trouble.

comment:4 follow-up: Changed 6 months ago by thenor

The problem still persists with Trac 1.0.1 and PostgreSQL as backend. For PostgreSQL, table creation syntax is a bit different:

CREATE TABLE mindmapcache (
    hash text PRIMARY KEY,
    content text 
);

Having done that, things work nicely.

Before adding the table by hand I tried trac-admin <myenv> upgrade - but got an error message:

Error:Attribute error:

In fact every trac-admin operation gave this error. Which disappeared once I had created the table by hand.

comment:5 Changed 6 months ago by thenor

  • Cc theodor.norup@… added
  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:6 in reply to: ↑ 4 ; follow-up: Changed 6 months ago by rjollos

  • Cc hasienda added

Replying to thenor:

The problem still persists with Trac 1.0.1 and PostgreSQL as backend. For PostgreSQL, table creation syntax is a bit different:

The Trac database API will create the proper SQL for PostgreSQL. Checking for table existing using a SELECT query (mindmapmacro/0.11/tracmindmap/macro.py@9152:56#L50) causes problems in Trac 1.0, IIRC. If the table is not being created when the plugin is installed, this is most likely the issue.

comment:7 in reply to: ↑ 6 Changed 6 months ago by thenor

Replying to rjollos:

Replying to thenor:
[...] If the table is not being created when the plugin is installed, this is most likely the issue.

Confirm, the table was *not* created upon plugin installation

comment:8 Changed 6 months ago by rjollos

Okay, thanks. I'll see about preparing a patch later this week.

Changed 6 months ago by rjollos

comment:9 Changed 6 months ago by rjollos

Proposed change in t7481.diff.

martin_s: Is it okay to commit?

I also noticed some other issues:

  • The source file mixes 2 and 4 space indentation.
  • ExtractUrlPlugin should be included in install_requires in setup.py.
Last edited 6 months ago by rjollos (previous) (diff)

Changed 6 months ago by rjollos

comment:10 Changed 6 months ago by rjollos

The patch has been improved to insert mindmap_version into the DB table: t7481.2.diff.

This will be useful in case the DB version is revised in the future.

comment:11 Changed 5 months ago by rjollos

In 13651:

Fixed database tables would not be added because test for table existence was not compatible with Trac 1.0. Refs #7481.

comment:12 Changed 5 months ago by rjollos

In 13652:

Normalized to 4-space indentation using reindent.py. Refs #7481.

comment:13 Changed 5 months ago by rjollos

In 13653:

Added ExtractUrlPlugin to install requirements. Refs #7481.

comment:14 Changed 5 months ago by rjollos

  • Owner changed from martin_s to rjollos
  • Status changed from reopened to accepted

Please report back if you have a chance to test the latest and can confirm whether the changes work for you.

comment:15 Changed 5 months ago by rjollos

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

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 rjollos. 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.