#11058 closed defect (fixed)
Can not create any projects
Reported by: | Dave | Owned by: | falkb |
---|---|---|---|
Priority: | high | Component: | SimpleMultiProjectPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
Updated .ini file and installed (thru GUI) the dist .egg
Everything appears to be working correctly. However, when I enter the Admin section for Manage Projects > Projects. There are none listed and when I create one, it does not populate.
Screen shot attached, but shows only newer UI.
Attachments (6)
Change History (38)
Changed 12 years ago by
Attachment: | Screen Shot 2013-05-07 at 12.00.34 PM.png added |
---|
comment:1 Changed 12 years ago by
comment:2 follow-ups: 3 4 Changed 12 years ago by
- Name of project: WebSite
- DB: MySQL
- PyVers: 2.7
- Browser: Chrome
I get an confirmation that the project was created. But nothing is listed and it cannot be selected from a ticket. There is nothing I can see in the trac.log file that would point to an cause.
Changed 12 years ago by
Attachment: | project.png added |
---|
comment:3 Changed 12 years ago by
Replying to WildShroom:
But nothing is listed
Where? URL path?
and it cannot be selected from a ticket.
Did you switch all modules of this plugin on? Please, check the plugin page on Admin.
There is nothing I can see in the trac.log file that would point to an cause.
Did you try to open trac.db with a common data base browser? Do you see what the smp_project table contains?
P.S.: your first attachment is not viewable.
comment:4 Changed 12 years ago by
Replying to WildShroom:
Name of project: WebSite DB: MySQL PyVers: 2.7 Browser: Chrome
I develop with SQLite, Python 2.5-2.7, Firefox & IE
comment:5 follow-up: 6 Changed 12 years ago by
Where: In the Trac UI. The project it confirmed is not listed.
Modules on: Yes. See screen shot.
Trac.db: Checking when admin get's back.
First screen shot is not required, and I deleted it. Ha!
Changed 12 years ago by
Attachment: | turned_on.png added |
---|
comment:6 Changed 12 years ago by
Replying to WildShroom:
Where: In the Trac UI. The project it confirmed is not listed.
Do you mean http://yourmachine/yourtracproject/admin/projects/simplemultiproject ?
comment:7 Changed 12 years ago by
...and did you consider 5. of SimpleMultiProjectPlugin#Installation ?
comment:8 Changed 12 years ago by
Yes, there. See screen shot.
And, there is nothing to chose in a ticket. Screen shot.
Changed 12 years ago by
Attachment: | admin_project_screen.png added |
---|
Changed 12 years ago by
Attachment: | ticket.png added |
---|
comment:9 Changed 12 years ago by
Well, I don't really think it's a permission issue (see 7) but something with the access to your MySQL database. I'd like to know what the content of your smp_... tables in your trac.db is.
comment:11 Changed 12 years ago by
There is quite a bit of SQL string formatting going on in simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py, which is likely to cause cross-DB compatibility issues.
I would recommend some changes such as (untested):
sqlInsertVersion = "INSERT INTO system (name, value) VALUES ('%s','%s')" % (db_version_key, db_version) cursor.execute(sqlInsertVersion)
->
cursor.execute(""" INSERT INTO system (name, value) VALUES (%s, %s)) """, (db_version_key, db_version))
See t:TracDev/DatabaseApi#RulesforDBAPIUsage for more details.
Changed 11 years ago by
Attachment: | mysql.patch added |
---|
for better considering the rules for DB API usage
comment:13 Changed 11 years ago by
Question: The click on the "Add" button calls this function in model.py:
def insert_project(self, name, summary, description): cursor = self.__get_cursor() query = """INSERT INTO smp_project (name, summary, description) VALUES (%s, %s, %s);""" cursor.execute(query, [name, summary, description])
Do you see a problem with the used syntax and your MySQL version?
comment:14 follow-up: 15 Changed 11 years ago by
For the part of your patch that applies to version.py
, I would recommend (untested):
"""SELECT id,status,%s FROM ticket WHERE %s=%s ORDER BY %s""", [field, any_name, any_value, field]
->
"""SELECT id,status,%%s FROM ticket WHERE %%s=%s ORDER BY %s""", % (field, field), (any_name, any_value)
and similarly for the other execute
statement. Everything else looks good.
I can't imagine any cross-DB compatibility problems with the SQL in comment:13. The trailing semicolon is unnecessary as far as I know, but shouldn't hurt anything.
comment:15 Changed 11 years ago by
Replying to rjollos:
For the part of your patch that applies to
version.py
, I would recommend (untested)... snip
After I looked at the DB API docs again I hope I've understood the %%s and %s thingy now. Does this look right now?
-
simplemultiproject/version.py
50 50 cursor = db.cursor() 51 51 fields = TicketSystem(env).get_ticket_fields() 52 52 if field in [f['name'] for f in fields if not f.get('custom')]: 53 cursor.execute(" SELECT id,status,%s FROM ticket WHERE %s='%s' ORDER BY %s" % (field, any_name, any_value, field))53 cursor.execute("""SELECT id,status,%s FROM ticket WHERE %s=%%s ORDER BY %s""" % (field, any_name, field), [any_value]) 54 54 else: 55 cursor.execute(" SELECT id,status,value FROM ticket LEFT OUTER JOIN ticket_custom ON (id=ticket AND name=%s) WHERE %s='%s' ORDER BY value", (field, any_name, any_value))55 cursor.execute("""SELECT id,status,value FROM ticket LEFT OUTER JOIN ticket_custom ON (id=ticket AND name=%%s) WHERE %s=%%s ORDER BY value""" % any_name, [field, any_value]) 56 56 tickets = [] 57 57 for tkt_id, status, fieldval in cursor: 58 58 tickets.append({'id': tkt_id, 'status': status, field: fieldval}) … … 400 400 cursor.execute(""" 401 401 SELECT DISTINCT COALESCE(%s,'') FROM ticket 402 402 ORDER BY COALESCE(%s,'') 403 """ % (by, by))403 """, [by, by]) 404 404 groups = [row[0] for row in cursor] 405 405 406 406 max_count = 0
comment:16 Changed 11 years ago by
Yeah, that looks right, and my patch was off, especially with regard to the %%s
and %s
.
comment:17 follow-up: 18 Changed 11 years ago by
comment:18 Changed 11 years ago by
comment:19 follow-up: 20 Changed 11 years ago by
Replying to WildShroom:
Updated .ini file and installed (thru GUI) the dist .egg
Everything appears to be working correctly. However, when I enter the Admin section for Manage Projects > Projects. There are none listed and when I create one, it does not populate.
Same here, can't add project from admin,
Yes, i've got a notification "The project has been added." but unfortunately the table "smp_project" remains empty.
comment:20 follow-up: 21 Changed 11 years ago by
Replying to klanjabrik:
Yes, i've got a notification "The project has been added." but unfortunately the table "smp_project" remains empty.
Need more details: Which SVN version, database type, Trac version, Python version, JavaScript on or off?
comment:21 follow-up: 22 Changed 11 years ago by
Replying to falkb:
Need more details: Which SVN version, database type, Trac version, Python version, JavaScript on or off?
SVN version: 1.6.11 database type: MySQL Trac version: Trac 1.0.1 Python version: Python 2.7.3 JavaScript: on
comment:22 follow-up: 23 Changed 11 years ago by
comment:23 Changed 11 years ago by
Replying to falkb:
sorry, I mean the plugin SVN version
I'm using Trac 1.0.1, so the SVN plugin already included in that version, cmiiw.
comment:24 follow-up: 25 Changed 11 years ago by
No, the plugin is not actually part of 1.0.1 or what distribution do you use?
comment:25 follow-up: 26 Changed 11 years ago by
Replying to falkb:
No, the plugin is not actually part of 1.0.1 or what distribution do you use?
if that's the case, then the SVN Plugin hasn't installed yet.
comment:26 follow-up: 27 Changed 11 years ago by
Replying to anonymous:
Replying to falkb:
No, the plugin is not actually part of 1.0.1 or what distribution do you use?
if that's the case, then the SVN Plugin hasn't installed yet.
Trac and its plugins are different shoes. Both ones are quite independent projects. Can you imagine someone has put both things together as distribution and you installed such package? So what is the name and version of your package? I decided for Bitnami Trac Stack and that comes without any plugin, and that is why I added this plugin manually, build from sources with a certain SVN revision. Since I fixed some things in [13125] I need to know if your plugin is < or >= that [13125], and what you exactly use. This way I maybe can better conclude what is going on and what runs different on your machine, you know it's working here without problems. Better is you can try to update from the latest SVN sources and tell me if it's working for you then.
comment:27 Changed 11 years ago by
Replying to falkb:
Trac and its plugins are different shoes. Both ones are quite independent projects. Can you imagine someone has put both things together as distribution and you installed such package? So what is the name and version of your package? I decided for Bitnami Trac Stack and that comes without any plugin, and that is why I added this plugin manually, build from sources with a certain SVN revision. Since I fixed some things in [13125] I need to know if your plugin is < or >= that [13125], and what you exactly use. This way I maybe can better conclude what is going on and what runs different on your machine, you know it's working here without problems. Better is you can try to update from the latest SVN sources and tell me if it's working for you then.
The plugin is >= 13125
i tried to input the project data manually from PhpMyAdmin, go back to Trac WebAdmin, modify the project from Trac WebAdmin, and nothing's changed. Maybe there are issues Insert and Update to database.
comment:28 follow-up: 29 Changed 11 years ago by
Solved,
I open the trac.log, and there is a failure to sync the repository, so i removed all repositories from WebAdmin, and now i can add and modify project.
Thanks.
comment:29 follow-up: 30 Changed 11 years ago by
Replying to klanjabrik:
Solved,
I open the trac.log, and there is a failure to sync the repository, so i removed all repositories from WebAdmin, and now i can add and modify project.
Thanks.
Glad, it works for you now. :-)
Do I understand it right, your Trac db access did not work correctly at all, independently from this plugin? Please, after playing around with projects and milestones do acknowledge SimpleMultiProjectPlugin works with MySQL databases now!
comment:30 Changed 11 years ago by
Replying to falkb:
Glad, it works for you now. :-)
Do I understand it right, your Trac db access did not work correctly at all, independently from this plugin? Please, after playing around with projects and milestones do acknowledge SimpleMultiProjectPlugin works with MySQL databases now!
Hahaha, yes sir!
This is my trac.log:
2013-05-28 15:00:22,298 Trac[main] DEBUG: Dispatching <RequestWithSession "POST '/admin/projects/simplemultiproject/16'"> 2013-05-28 15:00:22,300 Trac[api] WARNING: Unable to find repository '(default)' for synchronization
comment:31 follow-up: 32 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
happyusercount = happyusercount + 1
comment:32 Changed 11 years ago by
Replying to falkb:
happyusercount = happyusercount + 1
happyusercount += 1 might be considered more Pythonic ;)
Please, attach interesting parts of the log file (set DEBUG level in the Admin section), tell me the project name you tried, the versions of the underlying system you use for your Trac-1.0 (e.g. database and Python version, internet browser you use). You can also try to check your trac.db if the created project is written to the smp_project table.