Modify

Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#7366 closed defect (fixed)

Installing plugin crashes website

Reported by: anonymous Owned by: rjollos
Priority: highest Component: ContactsPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description (last modified by rjollos)

I installed this plugin using easy_install on Trac 0.12 and I get the following error when I try to trac-admin upgrade:

Contacts needs an upgrade
 * Upgrading db
TypeError: not all arguments converted during string formatting

I can no longer access my site.

Attachments (0)

Change History (10)

comment:1 Changed 4 years ago by Ulf

Hi,
to recover your site you could disable the plugin in your trac.ini file ([ENV]/conf/trac.ini).

You could also init the db for contacts by hand:

It seems something is wrong with the db init script. I fixed it by creating the contacts table manually:

CREATE TABLE [contact] (id int UNIQUE,first text,last text,position text,email text,phone text)

...and changing the value of an entry of the system table from 0 to 1 (contacts_version)

You could use an SQLite management tool to do so. After that the plugin works...

comment:2 Changed 4 years ago by anonymous

So what in blazes does this mean? Basically this plugin is broken before it's even installed? Why is it here? I have tried to install it and have not been able to get it working yet. I am not an sqlite master, just need to use trac with a contact mechanism.

comment:3 follow-ups: Changed 2 years ago by JJ

This really should be taken off the site until it is fixed. I tried to install it for one of my test environments, and it completely shut down our main Trac site. Not cool at all...

comment:4 in reply to: ↑ 3 Changed 2 years ago by rjollos

  • Owner changed from cmc to rjollos
  • Status changed from new to assigned

Replying to JJ:

This really should be taken off the site until it is fixed.

I'm not saying you are wrong, but the community is set up to allow anyone to make their code available, and there is no obligation for them to support it. This is effectively no different than navigating to someone's repository on GitHub, and trusting that their code is good without knowing anything about the person.

Eventually, I want trac-hacks to be better than this situation I described with GitHub, and I think you have a right to expect that there is some vetting of the code that is available here. Well, in fact there is some information available already - you should review the list of open issues for a plugin before you install it. Eventually though, I want to improve the user experience, by requiring all code to be licensed, and developing some sort of quality or confidence index for code. We are just not currently setup to do anything about this, and it will take some time to get there.

I tried to install it for one of my test environments, and it completely shut down our main Trac site. Not cool at all...

If I may make a suggestion from experience, you really need to have a staging site for testing out these plugins before promoting them. The reality is just that this is all open source code that hasn't been vetted, and precautions need to be taken.

I'll see if I can get this working for you now.

comment:5 Changed 2 years ago by rjollos

  • Description modified (diff)

comment:6 Changed 2 years ago by rjollos

(In [12246]) Refs #7366: Fixed multiple problems with DB upgrade during ContactsPlugin installation.

  • The unique attribute is not defined for the Column object in Trac 0.12, and in fact never did anything in earlier versions of Trac, which is why it was removed. See [11996] and [t 9406/trunk/trac/db/schema.py] for more info.
  • The print string, which intended to format and print the exception on database upgrade failure, contained an incorrect string formatting character. Even when corrected, the string would not be printed to the terminal, so this was replaced with printing of the traceback.

comment:7 Changed 2 years ago by rjollos

I think you will find that the installation goes smoothly and the Contacts table is added since the initial installation didn't get to the point of setting the contacts_version to 1. However, if you see an error message about the contacts table already existing, please execute the following cleanup steps.

  1. Install the sqlite3 package on your OS and make sure it is available at the command line (steps are OS dependent, on debian just run sudo apt-get install sqlite3).
  2. Execute the following from the command line.
    $ trac-admin $TRACENV hotcopy <backup-location>
    $ sqlite3 $TRACENV/db/trac.db
    
    sqlite> DELETE FROM system WHERE name='contacts_version';
    sqlite> DROP TABLE contact;
    

comment:8 Changed 2 years ago by rjollos

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

(In [12247]) Fixes #7366:

comment:9 Changed 2 years ago by rjollos

I think it is all fixed now, but please report back if you try again.

comment:10 in reply to: ↑ 3 Changed 2 years ago by rjollos

Replying to JJ:

I tried to install it for one of my test environments, and it completely shut down our main Trac site. Not cool at all...

I had overlooked the "test" when I read this the first time. The error that I and the original reporter saw was a repeated prompt for trac-admin env upgrade. Is that what you saw? This should only effect the environment that the plugin was enabled in. That is, unless there is some other issue that we need to discover here. I can't see how, if your environments are independent, enabling in a test environment could bring down your main site.

Add Comment

Modify Ticket

Action
as 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.