Modify

Opened 14 years ago

Closed 10 years ago

#7481 closed defect (fixed)

plugin MindMap cause my Trac server 500 error.

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: MindMapMacro
Severity: normal Keywords:
Cc: Theodor Norup, Steffen Hoffmann 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 Ryan J Ollos 10 years ago.
t7481.2.diff (2.5 KB) - added by Ryan J Ollos 10 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 14 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 14 years ago by Martin Scharrer

Status: newassigned

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 14 years ago by Martin Scharrer

Resolution: worksforme
Status: assignedclosed

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 Changed 10 years ago by Theodor Norup

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 10 years ago by Theodor Norup

Cc: Theodor Norup added; anonymous removed
Resolution: worksforme
Status: closedreopened

comment:6 in reply to:  4 ; Changed 10 years ago by Ryan J Ollos

Cc: Steffen Hoffmann 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 10 years ago by Theodor Norup

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 10 years ago by Ryan J Ollos

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

Changed 10 years ago by Ryan J Ollos

Attachment: t7481.diff added

comment:9 Changed 10 years ago by Ryan J Ollos

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 10 years ago by Ryan J Ollos (previous) (diff)

Changed 10 years ago by Ryan J Ollos

Attachment: t7481.2.diff added

comment:10 Changed 10 years ago by Ryan J Ollos

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 10 years ago by Ryan J Ollos

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 10 years ago by Ryan J Ollos

In 13652:

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

comment:13 Changed 10 years ago by Ryan J Ollos

In 13653:

Added ExtractUrlPlugin to install requirements. Refs #7481.

comment:14 Changed 10 years ago by Ryan J Ollos

Owner: changed from Martin Scharrer to Ryan J Ollos
Status: reopenedaccepted

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

comment:15 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.