Modify

Opened 14 years ago

Last modified 14 years ago

#7558 new defect

Bug on Trac 0.12: Error: unable to create image directory

Reported by: Luiz Fernando Owned by: Valient Gough
Priority: normal Component: LatexFormulaMacro
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

  • The following message is returning when trying to use this Macro on Trac 0.12:

Error: unable to create image directory

  • My environment:
    • Ubuntu 10.10 amd64 server

System Information

Trac 0.12
Genshi 0.6
mod_wsgi 2.8 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
psycopg2 2.0.13
Pygments 1.2.2
Python 2.6.5 (r265:79063, Apr 16 2010, 14:15:55) [GCC 4.4.3]
setuptools 0.6
Subversion 1.6.6 (r40053)
jQuery: 1.4.2

Installed Plugins

Backlinks N/A /usr/local/lib/python2.6/dist-packages/Backlinks.pyc
ChangeLogMacro 0.2-r7928 /usr/local/lib/python2.6/dist-packages/ChangeLogMacro-0.2_r7928-py2.6.egg
ComponentsListMacro N/A /usr/local/lib/python2.6/dist-packages/ComponentsListMacro.pyc
TicketImport 0.8 /usr/local/lib/python2.6/dist-packages/TicketImport-0.8-py2.6.egg
TracSectionEditPlugin 0.1 /usr/local/lib/python2.6/dist-packages/TracSectionEditPlugin-0.1-py2.6.egg
TracTags 0.6 /usr/local/lib/python2.6/dist-packages/TracTags-0.6-py2.6.egg

Attachments (0)

Change History (4)

comment:1 Changed 14 years ago by Ryan J Ollos

It looks like it creates a directory named formulas within htdocs_dir. See formula.py line 132. Perhaps it is just a permissions issue?

comment:2 Changed 14 years ago by Luiz Fernando

Thanks for your promptly reply!

  • I've verified and the macro is trying to create the image dir in the project environment htdocs dir. However, my project environment directories don't have the htdocs subdir. Perhaps this is happening because I am using the same project directories since Trac 0.9 (copying and pasting the dirs on every trac update) and new versions of Trac are creating these local htdocs subdirs automatically. Creating manually the project local htdocs dir solves the problem.
  • The question is: since I am installing the plugin globally, shouldn't it use the htdocs dir given by the htdocs_location parameter on trac.ini?

Regards

comment:3 in reply to:  2 Changed 14 years ago by Ryan J Ollos

Replying to luizfernando:

  • The question is: since I am installing the plugin globally, shouldn't it use the htdocs dir given by the htdocs_location parameter on trac.ini?

I guess we need to figure out what exception is being thrown by os.mkdir. I'm new to Python, but can we do that by inserting raise into the except: block?

To answer your other question, it might be useful to print the directory path

try:
    os.mkdir(imagePath)
except:
    return "<b>Error: unable to create image directory %s</b><br>" % imagePath   

comment:4 in reply to:  2 Changed 14 years ago by Ryan J Ollos

Replying to luizfernando:

Creating manually the project local htdocs dir solves the problem.

This makes me think that you have permission to create the directory manually, but Trac does not.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Valient Gough.

Add Comment


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

 
Note: See TracTickets for help on using tickets.