Unable to save to file in any location (including public and private folders). Not a permissions issue (eg tried 777 to be sure).
Currently, the response simply reads: "Can't write to the specified location". A closer look and we find the following code in aes.module around L242:

function aes_config_validate($form, &$form_state) {
...
//if the storage method is set to File, check that the file can be openend for writing
if ($form_state['values']['aes_key_storage_method'] == "File") {
  $fp = fopen($form_state['values']['aes_key_path'], "a");
  if ($fp === false) {
    @form_set_error("aes_key_path", t("Can't write to the specified location."));
  }
  else {
    fclose($fp);
  }
}
...

I removed the "@" on line 242 to see the error message, which simply referred back to this line. (However see what SPTM say about using "@")
Anyhow, see also this documentation issue -- in order to get this working, I had to create the file first in the private directory and then provide the full path to it (/var/www/sites/.../files/private/.aeskey). I don't know why the php fopen(..., "a") wouldn't create the file.

Comments

Anonymous’s picture

thanks man this really helped i was breaking my head until i saw your post

3rdLOF’s picture

This is uber-furstratin. I cannot get it to work no matter what I do. I chaged permissions, did what it shows here....Nothing. No dice.

3rdLOF’s picture

Well, I got it working only after reseting multiple folders to 777 and then setting back to normal.

I did forget to mention this is an Aegir-controlled install, so there are issues with folder ownership between the "aegir" user and the www-data user.

luxpir’s picture

That helped here also, with the latest versions etc. as of this post date.

Have .aeskey file ownership as php user, with nginx allowing internal access only.

dpovshed’s picture

Issue summary:View changes
Status:Active» Closed (works as designed)

It seems that described difficulties are related more to system administrations than to the module code itself.

Feel free to reopen if I am wrong here. Please provide desired resolution to your problem if you still have any with the current version.

judikins’s picture

Issue summary:View changes

Hi there. After following suggestions about how to solve AES configuration issue, I am still getting, "can't write to specified location." Tried above permission settings. This happens when selecting Key storage method as File instead of Database. It appears the "File" method is needed by Commerce_ups module so I am stumped. Dpovshed mentioned "a system admin issue" instead of AES code problem. I am not sure what to look for in Sys Admin. Thanks for any suggestions.

p.s. I'm working on MAMP, D7.37, AES 7x-1.9
p.p.s. How do you re-open an issue? Thx.

judikins’s picture

I tried again, with the -dev version and received this "Warning: opendir(sites/all/modules/aes/phpseclib): failed to open dir: Permission denied in file_scan_directory() (line 2118 of includes/file.inc)" so I changed the permission on the phpseclib directory to readable, and yea. So far all is good.

dpovshed’s picture

Issue summary:View changes

@judikins, I am glad you had find your way.

BTW next time please do not delete/edit Issue Summary unless you're really need to adjust something.