I noticed a closed issue for this when somone had a localhost site on windows. This is on a Linux staging box and happens on every page load. I am not sure exactly what information you want, but let me know and I will provide it.

CommentFileSizeAuthor
#14 Screenshot.png53.45 KBac

Comments

ac’s picture

More info:

Using the typekit API only. When I import fonts from typekit after adding the API key it imports 5 extra fonts that aren't in my kit. These fonts are automatically enabled and start to overide the real fonts I want to use.. very strange.

sreynen’s picture

Category: bug » support

For the permissions error, you need to change the permissions on your sites/default/files directory. The exact permissions depend on your particular setup. See:

http://drupal.org/node/244924

To look at why Typekit is importing extra fonts, I'd need to look at your Typekit project. Please send me your kit ID via the contact form. (You shouldn't post it here, as those keys are supposed to be private.) In general, @font-yourface gets all its import information from Typekit, so I can't imagine how that would happen unless there's an issue on Typekit's side.

These both sound like configuration issues, so I'm changing this to a support request.

g76’s picture

Version: 7.x-1.3 » 7.x-1.x-dev

same issue, running on Aegir, shouldn't be a server-config issue. I am only using google fonts, not typekit at all. using latest dev version.

sreynen’s picture

Status: Active » Postponed (maintainer needs more info)

shouldn't be a server-config issue

Looking at the code, I don't see how it could possibly not be a server config issue.

The error comes from drupal_chmod, called by file_unmanaged_copy(), file_unmanaged_move(), file_unmanaged_save_data(), fontyourface_preprocess_page(). The error happens when chmod() fails, and chmod() fails when the server user doesn't have permissions to change permissions on the file.

What are the permissions on that file, who is the owner, and what user is your server running as?

ac’s picture

Also using Aegir.. here are the permissions (www-data is apache user obviously)

drwxrws--- 14 aegir www-data   4096 2011-05-19 04:07 files
drwxrwxr-x  2 aegir www-data 4096 2011-05-09 13:49 fontyourface
-rwxrwxr-x  1 aegir www-data    0 2011-06-07 09:04 font.css
ac’s picture

Status: Postponed (maintainer needs more info) » Active

Changing status

g76’s picture

I am really sorry, it seems I probably jumped the gun with my statement. I also should have posted more info and hope that you will accept my apologies. I really love your module and sincerely appreciate all your hard work and that you open that up to the community and do not take that for granted. As I have taken a closer look(which I should have initially), despite the error it is writing to the font.css file just fine.

thank you again, and again please accept my apologies.

Jen

ac’s picture

Any thoughts sreynen? The webserver group has permissions to modify that file and that file is getting modified. It is just being logged as an error to watchdog.

ac’s picture

Also, the typekit bug has gone away without any changes at this end so I suspect you were right in suggesting that was a Typekit API error.

sreynen’s picture

Status: Active » Postponed (maintainer needs more info)

My guess is this is an Aegir-specific issue. I don't have an Aegir install handy to test this on, but there are a few notes in PHP's chmod() documentation that sound like they might be relevant. Specifically, "When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed" seems a likely cause. If you install Devel, you can confirm if you're running in safe_mode at /devel/phpinfo. You can also confirm which user your server is running as by executing this at /devel/php:

return exec('whoami');

Please post that information here and set this back to "active."

ac’s picture

Status: Postponed (maintainer needs more info) » Active

The server runs as www-data which is the group of the files which also has rwx. The server does not run in safe mode.

sreynen’s picture

I'm kind of stumped. I guess I'd probably try changing the permissions to 777 briefly just to see if the error still shows up. That will at least confirm whether or not it's a permissions error.

ac’s picture

I set fontyourface directory and font.css to 777 and the error is still being logged.

ac’s picture

StatusFileSize
new53.45 KB

More information on initial error:

1) enabled fontyourface 7.x.1-3 and typekit API
2) add typekit api key
3) import fonts (total ends up as 7, should be 2)
4) Browse to fontyourface section in appearance (see screenshot - the only fonts meant to be there are the P22 ones)
5) The extra 5 fonts are enabled.

I can replicated this every time by uninstalling the module and re enabling it.

sreynen’s picture

ac, I'm a little confused. At which of those 5 steps do you see the error? Or is this a separate problem?

ac’s picture

The error in watchdog happens on every page load. This issue was the one I mentioned at the start of this issue that you thought might be a campaign monitor issue.

cpelham’s picture

I am also getting this error though fontyourface folder and font.css permissions are set to 777. I am using Ubuntu Lucid on a Rackspace cloud server.

sreynen’s picture

I'm currently out of guesses as to what's going on with this issue. If anyone is willing to give me direct access to a server where this is happening, I'd be happy to see if I can figure anything out. You can use my private contact form to send info.

flosuter’s picture

I had the same issue after migrating a site with aegir.
I just deleted the files/fontyourface/ folder and now everything works again as expected.

ac’s picture

I can confirm that removing the directory solves the issue. The directory was owned by the aegir user and in the apache group. When it is recreated after being removed it is owned by apache and in the apache group. It seems group write permission aren't enough. Don't know if there is much this module can do about this so you can probably close this.

sreynen’s picture

Title: The file permissions could not be set on public://fontyourface/font.css. » The file permissions could not be set on public://fontyourface/font.css after moving with Aegir
Project: @font-your-face » Hostmaster (Aegir)
Version: 7.x-1.x-dev » 6.x-1.3

I'm moving this to the Hostmaster queue. This seems to be the part of Aegir that does the actual moving, which should be where the directory owner is being set to aegir. I'm just guessing on the version number.

rowbotony’s picture

Confirm with post #19 and #20 - I imported a site in to an Aegir platform then fontyourface started complaining in watchdog about not being able to set file permissions - I deleted the files/fontyourface/ folder, it was then automatically recreated and all is fixed now.

UPDATE..... not so much. The web server will recreate the directory with the owner/group as www-data:www-data, but shouldn't it be aegir:www-data? All of the rest of my files are owned by aegir:www-data. So when I chown back to aegir:www-data I get the permission error again :(

sreynen’s picture

Status: Active » Fixed

www-data is Drupal (more specifically, whatever server is running Drupal). aegir is, well, Aegir. So your files are owned by Aegir when Aegir created them, and by Drupal when Drupal created them. It sounds like Drupal can't edit files that Aegir created, which is a problem with how user groups are set up on your server, not something we can fix in the module. I'm marking this as "fixed," as I don't see anything else we can do on this. If anyone else sees an opportunity to resolve this in the module code, please re-open.

rowbotony’s picture

Thanks sreynen, this was indeed a group permissions problem, nothing to do with the Hostmaster module itself.

Update for future reference - everything is functioning properly for me now that I added the "www-data" user to the aegir group. I thought I had done that previously when I installed Aegir, but apparently I didn't have the setup right in the first place. So the command # usermod -a -G aegir www-data worked for me to add www-data (apache server) to the aegir group so they can work with each others files.

Status: Fixed » Closed (fixed)

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

hyperglide’s picture

Status: Closed (fixed) » Active

Hello,

I have re-opened this issue as I am experiencing the same problem.

Per #24 I have verified that "www-data" is i the "aegir" group.

aegir : aegir www-data
www-data : www-data

We are using AEgir from the BOA project.

Thank you,
Hg

sreynen’s picture

HyperGlide, what are the permissions set on the directory/file throwing permissions errors?

hyperglide’s picture

@sreynen - thanks for the reply.

drwxrwsr-x 2 www-data 4096 May 9 11:56 fontyourface

joestewart’s picture

HyperGlide - aegir should be a member of the www-data group.

You don't want www-data being able to write to all files owned by aegir. But do want files/directories in the www-data group to be able to written by aegir user.

joestewart’s picture

HyperGlide,

The Barracuda script adds to aegir to the www-data group:

http://drupalcode.org/project/barracuda.git/blob/refs/heads/master:/BARR...

And the manual installation says the same:

http://community.aegirproject.org/installing/manual#Create_the_Aegir_user

hyperglide’s picture

@ joestewart

Thank you for the reply -- I had thought that BOA would fix this issue automatically with it's permission checks.
I have not made any changes to the groups or permissions.

Fix:
1 - Add "aegir" to the "www-data" group.
2- Remove "www-data" from the "aegir" group

Will adjust per the documents and confirm solution.

Thank you,
Hg

sreynen’s picture

Status: Active » Fixed

Sounds like this is fixed again.

hyperglide’s picture

Status: Fixed » Active

Regrets for a previous error.

Checking the groups again, making use of the (2) commands:

$grep aegir /etc/group and $getent group aegir
$grep www-data /etc/group and $getent group www-data

shows:

aegir:  aegir:x:113:
www-data: www-data:x:33:aegir,dev,

"www-data" does not appear to be in the "aegir" group.
"dev" is our boa satellite user for the site having the file warning.

Thank you again for the help.

rowbotony’s picture

From Aegir Troubleshooting:
http://community.aegirproject.org/aegir-handbook/getting-help/troublesho...

This will also show aegir groups:

# id aegir
uid=106(aegir) gid=117(aegir) groups=117(aegir),33(www-data)
hyperglide’s picture

@drupleg - Thanks!

server:~# id aegir
uid=110(aegir) gid=113(aegir) groups=113(aegir),33(www-data)
hyperglide’s picture

any ideas on the cause?

gandhiano’s picture

I was having the same problem, with the aegir setup mentioned here. The problem seems to have been solved by removing the 0 bytes font.css:

-rw-rw-r-- 1 aegir www-data 0 Jun 21 15:04 font.css

It recreates with www-data ownership:

-rw-rw-r-- 1 www-data www-data 0 Jun 21 15:12 font.css

I'm not sure what could be the cause, because aegir is in the www-data group, but the errors stopped.

Note: my platform is in a remote server. I guess these working permissions would be broken during the standard verify process of aegir. I am using a patch from #1561102: Allow spokes to change their themes and modules , which disables syncing the files/ to the remote host

hyperglide’s picture

@gandhiano thanks.

Not sure is our issue looking at font.css we have:

-rw-rw-r-- 1 dev www-data 74 Jun 22 01:04 font.css

Tried it anyways and initial results is positive. WIll keep an eye on the log.

Thanks again.

hyperglide’s picture

Status: Active » Closed (fixed)

Marking closed :-)