Opened 4 years ago

Closed 4 years ago

# File permission errors

Reported by: Owned by: anonymous Ryan J Ollos normal GraphvizPlugin normal Christian Boos 1.0

I'm not sure what causes it but quite often the following error is thrown when trying to check in a new graph. The error occurs at line 640 in graphviz.py (0.7.5dev):

    os.unlink(os.path.join(self.cache_dir, file))


Trac detected an internal error:

WindowsError: [Error 5] Access is denied: u'D:\\www\\apache\\trac\\htdocs\\acct_mgr'


### comment:1 Changed 4 years ago by Jun Omae

Description: modified (diff)

### comment:2 Changed 4 years ago by Ryan J Ollos

In 13275:

Refs #11155: Make tagged versions final, and bump version on trunk.

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

Cc: Christian Boos added; anonymous removed changed from Peter Kropf to Ryan J Ollos new → assigned

I'm not sure what causes it but quite often the following error is thrown when trying to check in a new graph.

Just to be certain, do you mean when the wiki page is saved?

The error occurs at line 640 in graphviz.py (0.7.5dev):

    os.unlink(os.path.join(self.cache_dir, file))


Trac detected an internal error:

WindowsError: [Error 5] Access is denied: u'D:\\www\\apache\\trac\\htdocs\\acct_mgr'


It looks like you've installed from the 0.11-0.7.5 tag, except that the exception must be coming from line 620, not 640, if that is the case.

Side note: Since 0.11-0.7.5 is a "tag", I've bumped the version from 0.7.5dev to 0.7.6 just now, and bumped the trunk to 0.7.7dev (from 0.7.6dev). The development lines for this plugin are a bit of a mess at the moment since the trunk and 1.0 have diverged. I will need to discuss with cboos how to sort that out.

What value have you set for [graphviz] cache_dir in trac.ini? It looks as though you have cache_dir = D:\www\apache\trac, and it is trying to clean out files in your Trac environment directory. If you remove the cache_dir option from trac.ini, it looks like it should create a dir named gvcache in your Trac environment directory.

Finally, I would like to encourage you to register for an account so that you'll receive email notifications when someone replies to a ticket that you've opened.

### comment:5 follow-up:  6 Changed 4 years ago by anonymous

I have the following set: cache_dir = D:\www\apache\trac\htdocs.

The cache manager is an attempt at keeping the cache directory under control. This is experimental code that may cause more problems than it fixes.

Should I disable it just to be sure?

Unfortunately I don't really have the time to update to the latest version right now. I always have to figure out again how to install trac packages on Windows..

### comment:6 in reply to:  5 Changed 4 years ago by Ryan J Ollos

Keywords: needinfo removed → worksforme assigned → closed

I have the following set: cache_dir = D:\www\apache\trac\htdocs.

You shouldn't be storing directly in htdocs. You could store in htdocs\gvcache or some other directory below htdocs if you can get the permissions set correctly for that directory. You see, the GraphvizPlugin cleans up after itself in order to keep the cache size from growing too large, so you shouldn't mix your htdocs and graphviz files in the same directory, otherwise GraphvizPlugin could try to delete important files such as JavaScript and CSS source code that is stored in htdocs.

What led you to use that location? Is it because you've configured your webserver to serve static files from that location, and you'd like the webserver to handle image files rather than Trac?

The cache manager is an attempt at keeping the cache directory under control. This is experimental code that may cause more problems than it fixes.

Should I disable it just to be sure?

I think you should just change cache_dir. If you don't care where the files are stored (i.e. no webserver considerations), just remove the cache_dir option from trac.ini.

Unfortunately I don't really have the time to update to the latest version right now. I always have to figure out again how to install trac packages on Windows..

No reason to update at this time. Just change your configuration.

### comment:7 in reply to:  3 ; follow-up:  11 Changed 14 months ago by Christian Boos

The development lines for this plugin are a bit of a mess at the moment since the trunk and 1.0 have diverged. I will need to discuss with cboos how to sort that out.

I've just found out about this myself now ;-) Will fix (trunk -> tags/0.11-0.7.7, 1.0 -> trunk).

### comment:8 Changed 14 months ago by Christian Boos

In 15365:

GraphvizPlugin: freeze old trunk to version 0.7.7. Refs #11155.

### comment:9 Changed 14 months ago by Christian Boos

In 15366:

GraphvizPlugin: prepare for new trunk, rebased on 1.0 branch. Refs #11155.

### comment:10 Changed 14 months ago by Christian Boos

In 15369:

GraphvizPlugin: restart trunk based on 1.0 branch (1.0.0.8). Refs #11155.

### comment:11 in reply to:  7 ; follow-up:  12 Changed 14 months ago by Christian Boos

The development lines for this plugin are a bit of a mess at the moment since the trunk and 1.0 have diverged. I will need to discuss with cboos how to sort that out.

I've just found out about this myself now ;-) Will fix (trunk -> tags/0.11-0.7.7, 1.0 -> trunk).

Done. I think it's better now.

Besides the clarification, I have a few plans for the trunk version:

• make it compatible with the Jinja2 branch (i.e. no Genshi)
• move the cache_manager infrastructure and some utilities for gathering content from executing binaries in Trac proper (trac.mimeview.cache?)

### comment:12 in reply to:  11 Changed 14 months ago by Ryan J Ollos

• move the cache_manager infrastructure and some utilities for gathering content from executing binaries in Trac proper (trac.mimeview.cache?)

That's great. I've wanted to do that as well since it will help with several plugins that cache images. PlantUmlMacro is the one that comes to mind immediately.

### Modify Ticket

Change Properties