Opened 7 years ago

Closed 4 years ago

plugin MindMap cause my Trac server 500 error.

Reported by: Owned by: anonymous Ryan J Ollos normal MindMapMacro normal Theodor Norup, Steffen Hoffmann 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?

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

Status: new → assigned

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


The macro stores some information in the database.

comment:3 Changed 7 years ago by Martin Scharrer

Resolution: → worksforme assigned → 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:  6 Changed 4 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 4 years ago by Theodor Norup

Cc: Theodor Norup added; anonymous removed worksforme closed → reopened

comment:6 in reply to:  4 ; follow-up:  7 Changed 4 years ago by Ryan J Ollos

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

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

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

comment:9 Changed 4 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 4 years ago by Ryan J Ollos (previous) (diff)

comment:10 Changed 4 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 4 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 4 years ago by Ryan J Ollos

In 13652:

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

comment:13 Changed 4 years ago by Ryan J Ollos

In 13653:

Added ExtractUrlPlugin to install requirements. Refs #7481.

comment:14 Changed 4 years ago by Ryan J Ollos

Owner: changed from Martin Scharrer to Ryan J Ollos reopened → 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 4 years ago by Ryan J Ollos

Resolution: → fixed accepted → closed

Modify Ticket

Change Properties