Comments

markhalliwell’s picture

Component: Code » Miscellaneous
Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Sounds like you're having issues with file permissions, which is a server configuration error... not this module.

WorldFallz’s picture

I ran into this as well. And normally, i would totally agree that its likely a server permissions issue. However, i've been actively developing on my current server for a while (months), and doing all sorts of drupal file handling and never had this error happen before. And none of the googlable suggestions I've tried make any difference.

It seems highly unlikely this would be the first time a core or contrib would be using the drupal_unlink function so it leaves me wondering if indeed, there's not something up with the file handling here or if this error is being thrown and actually masking another. I've spent quite literally many hours on this and can't make any progress. And, unlike the other poster, it's not just matter of not deleting the tmp file (which wouldn't really bother me). I'm also not seeing the fontello icon bundle at all.

Not sure what else to try, but figured I would post in case someone else has the same issue or anyone has any suggestions on where else to look.

pjc’s picture

Same thing here... even after granting full permissions to IUSR and Everyone I'm still getting the access denied error. Was anyone able to get it to work?

markhalliwell’s picture

Could y'all try the dev version? There's a few fixed that might help resolve this maybe. Just want to make sure this is still a valid issue. If it does, I'll schedule a release soon. Thanks!

WorldFallz’s picture

still no joy, the exact error is:

An error occured while attempting to extract the uploaded archive. Check the logs for more details.
Warning: unlink(C:\inetpub\wwwroot\sites\default\files\tmp\fontello-8b47ae3e.zip): Permission denied in drupal_unlink() (line 2197 of C:\inetpub\wwwroot\includes\file.inc).

I'm not sure if I remember getting the extract error previously.

When I check the log, before the unlink error, i see:

The file public://icon/fontello/testinfontello was not deleted, because it does not exist.

So it looks like the unlink error is indeed masking another issue-- and the file is not extracting properly on windows. At least it give me a new avenue of debugging!

WorldFallz’s picture

nope... it's being extracted properly. I've traced it down to something in icon_file_move_recursive... the hunt continues...

markhalliwell’s picture

If you get on IRC, I could maybe help you sift through the code :)

WorldFallz’s picture

unfortunately i'm at my day job, and in their infinite wisdom, it's blocked... :-(

WorldFallz’s picture

i think I'm at my wits end for a bit. It unlinks all the individual files in the archive just fine, and then fails on the zip:

C:\inetpub\wwwroot\sites\default\files\icon\fontello\lkjlkjkljlkjl\config.json - unlink=TRUE
public://icon/fontello/lkjlkjkljlkjl/config.json - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\icon\fontello\lkjlkjkljlkjl\css\animation.css - unlink=TRUE
public://icon/fontello/lkjlkjkljlkjl/css/animation.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\icon\fontello\lkjlkjkljlkjl\css\fontello-custom-codes.css - unlink=TRUE
public://icon/fontello/lkjlkjkljlkjl/css/fontello-custom-codes.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\icon\fontello\lkjlkjkljlkjl\css\fontello-custom-embedded.css - unlink=TRUE
public://icon/fontello/lkjlkjkljlkjl/css/fontello-custom-embedded.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\icon\fontello\lkjlkjkljlkjl\css\fontello-custom-ie7-codes.css - unlink=TRUE
public://icon/fontello/lkjlkjkljlkjl/css/fontello-custom-ie7-codes.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\icon\fontello\lkjlkjkljlkjl\css\fontello-custom-ie7.css - unlink=TRUE
public://icon/fontello/lkjlkjkljlkjl/css/fontello-custom-ie7.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\icon\fontello\lkjlkjkljlkjl\css\fontello-custom.css - unlink=TRUE
public://icon/fontello/lkjlkjkljlkjl/css/fontello-custom.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\css\animation.css - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/css/animation.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\css\fontello-custom-codes.css - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/css/fontello-custom-codes.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\css\fontello-custom-embedded.css - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/css/fontello-custom-embedded.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\css\fontello-custom-ie7-codes.css - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/css/fontello-custom-ie7-codes.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\css\fontello-custom-ie7.css - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/css/fontello-custom-ie7.css - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\css\fontello-custom.css - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/css/fontello-custom.css - unlink=TRUE

***C:\inetpub\wwwroot\sites\default\files\tmp\fontello.zip - unlink=FALSE
***temporary://fontello.zip - unlink=FALSE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\config.json - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/config.json - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\demo.html - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/demo.html - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\font\fontello-custom.eot - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/font/fontello-custom.eot - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\font\fontello-custom.svg - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/font/fontello-custom.svg - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\font\fontello-custom.ttf - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/font/fontello-custom.ttf - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\font\fontello-custom.woff - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/font/fontello-custom.woff - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\LICENSE.txt - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/LICENSE.txt - unlink=TRUE

C:\inetpub\wwwroot\sites\default\files\tmp\icon_api_b8e224eaad682f6fc6a6483c0a7a13b4\fontello-8b47ae3e\README.txt - unlink=TRUE
temporary://icon_api_b8e224eaad682f6fc6a6483c0a7a13b4/fontello-8b47ae3e/README.txt - unlink=TRUE

it seems to be something about the actual uploaded file, but how can all my other drupal file operations work fine?

i'm at a total loss

WorldFallz’s picture

and when I check the permissions on that file in the security tab, all users (IUSR / Users / IIS_IUSRS) all have 'Full Control'. I'm totally baffled.

markhalliwell’s picture

Could you give your watchdog errors? That might help narrow this down :)

WorldFallz’s picture

StatusFileSize
new16.61 KB
new13.47 KB

sure... I only get 2:

First:
screencap

Second:
screencap

pjc’s picture

Sounds like this could be related to https://drupal.org/node/1887044... Seems FastCGI will attempt to delete or move the directory before it's closed. I found a few other posts through google mentioning PHP unlink() issues with windows, particularly regarding the "read-only" flag set on all folders by default, but after trying the suggested workarounds I wasn't able to get it to work. My guess is it's a server config issue and not the module, but that's just a guess :/

WorldFallz’s picture

Like I said above, normally I would totally agree... But I'm doing a lot of file and image field handling, both public and private, and have no issues with any other files with core or contrib (deleting, moving, whatever). it could still be a weird server issue but it definitely has something to do with the way this module is handling files versus all the others I'm using. Any only the uploaded file... None of the extracted files have any issues.

markhalliwell’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.57 KB

Thanks @pjc! That link was helpful. Try this patch and see if it fixes y'alls issue :)

markhalliwell’s picture

Sorry, try this instead. There's a variable name mismatch in the previous one.

WorldFallz’s picture

progress using the patch from #16-- the unlink error is gone!!!! I had a feeling it had something do with properly unlocking the zip file, but in all my hours of googling i never did stumble across that post.

However, now I'm getting:

An error occured while attempting to extract the uploaded archive. Check the logs for more details.

And in the watchdog table the only message is the same as the first screen cap in #12: "The file public://icon/fontello/fontello_icons was not deleted, because it does not exist.". It seems to be treating the directory 'C:\inetpub\wwwroot\sites\default\files\icon\fontello\fontello_icons' as a file or something. I'll see if I can trace down where....

thanks for all the progress so far!

markhalliwell’s picture

Try this. It could be that PHP on Windows has trouble with the drupal specific URI paths. Btw, what version of PHP are you using?

markhalliwell’s picture

Crap, try this one instead... shouldn't have wrapped the recursion one heh

WorldFallz’s picture

BRILLIANT!

Works perfectly.

Just one question, shouldn't line 276 of utilities.inc if (is_dir($source)) { also be if (is_dir(drupal_realpath($source))) {?

markhalliwell’s picture

Ah, good catch. If you don't get any errors and you can finally successfully import a fontello zip (and select/view the icons), I'll go ahead and commit this to dev :)

WorldFallz’s picture

I'll checkout a fresh copy, patch, and test again from scratch...

WorldFallz’s picture

StatusFileSize
new4.37 KB

Patch applied cleanly and worked perfectly. Just one minor nit-- i found a file_delete without a corresponding $archiver->getArchive()->close(); -- patch attached.

man, i just love it when open source works exactly like it's supposed to!

WorldFallz’s picture

and i learned tons about os agnostic file handling with drupal to boot ;-)

WorldFallz’s picture

and for completeness sake-- I'm using:

Windows Server 2008 R2 Standard
MS SQL Server 2012
IIS v6.1 SP 1

(no choice in the matter for the above config)

PHP 5.3.24
Drupal 7.23
Icon 7.x-1.x-dev

markhalliwell’s picture

Thanks everyone :)

Committed #21: 9425433

+++ b/includes/import.inc
@@ -69,16 +69,17 @@ function icon_provider_import_form_validate($form, &$form_state) {
   catch (Exception $e) {
     form_set_error('file', $e->getMessage());
+    $archiver->getArchive()->close();
     file_delete($file);
     file_unmanaged_delete_recursive($temp_dir);
     return;

@WorldFallz, the reason I left this out here, is because this is an error catch block. $archiver may not actually be an object (ie: it may just return FALSE. In either case, it should be safe to just delete. Besides, the extraction failed... so it shouldn't be open in the first place :)

pjc’s picture

You rock. Many thanks for this!!

WorldFallz’s picture

Component: Miscellaneous » Code
Category: support » bug
Priority: Normal » Major
Status: Needs review » Fixed

excellent-- thanks for info. file handling is one of my weak points... this helps a lot.

markhalliwell’s picture

Also, FWIW, I just created a 7.x-1.0-beta3 release :) https://drupal.org/node/2066181

edit: might take a while for it to generate (ie: 10-20 min) fyi

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 9425433 on 7.x-1.x, 8.x-1.x, icon_tabs-integration by Mark Carver:
    Issue #2026919 by Mark Carver: Warning: unlink(C:\Windows\Temp\fontello-...