On api.aegirproject.org, we're using the API module to generate the docs. Since we need to provide Absolute paths to index, one per line., I figured we'd use the 'clients' directory feature. This is to avoid breakage when the site is migrated to a new platform. But I then get this error:

/var/aegir/clients/cl-aegirproject/api.aegirproject.site.koumbit.net/private/files/drush-7.x-4.x is not a directory.

The relevant validation function is in api.admin.inc:

<?php
252 /**
253 * Verifies that all directories exist and are actually directories.
254 *
255 * Element validation callback for 'data'/'directories' element of
256 * api_branch_edit_form_files().
257 */
258 function api_check_directories($element, &$form_state) {
259   // Check for valid directories.
260   foreach (explode("\n", $element['#value']) as $directory) {
261     $directory = trim($directory);
262     if (!empty($directory)) {
263       if (!is_dir($directory)) {
264         form_set_error($element['#name'], t('%directory is not a directory.', array('%directory' => $directory)));
265       }
266       elseif (!is_readable($directory)) {
267         form_set_error($element['#name'], t('%directory is not readable by PHP.', array('%directory' => $directory)));
268       }
269     }
270   }
271   form_set_value($element, api_clean_directory_list($element['#value']), $form_state);
272 }
?>

So, basically, id_dir($directory) is returning false. Is there something strange with the way these clients directories are symlinked? Could this be an issue with how we've implemented provision_acl?

My thoughts in the short-term are just to comment out this function, along with the line in the form function that references it.

Comments

steven jones’s picture

Assigned: Unassigned » anarcat

I think this issue is for you anarcat, but ergonlogic, you seem to have got this working in the mean time anyway?

ergonlogic’s picture

Actually, I commented out these form element validation lines, which allowed me to set the /var/aegir/clients/... path. Unfortunately, it didn't work, as api.module couldn't seem to resolve the path. I'll test further and post a follow-up with the errors from dblog.

anarcat’s picture

It is quite possible the clients directory is not accessible to the webserver, so it can't read the symlinks... I guess that would need to be tested...?

steven jones’s picture

Status: Active » Fixed

The API site seems fine now.

Status: Fixed » Closed (fixed)

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