StaticSync Setup Issue

930 views
Skip to first unread message

Larry Wapnitsky

unread,
Feb 16, 2012, 11:58:08 AM2/16/12
to resour...@googlegroups.com
I'm trying to test StaticSync, but am constantly getting errors when I try to run the PHP file at the CLI (Debian).

Here is a copy of the section of my config.php:

# ------------------------------------------------------------------------------------------------------------------
# StaticSync (staticsync.php)
# The ability to synchronise ResourceSpace with a separate and stand-alone filestore.
# ------------------------------------------------------------------------------------------------------------------
#$syncdir="/var/www/r2000/accounted"; # The sync folder
$syncdir="/var/www/resourcespace/staticsync_import";
#$nogo="[folder1]"; # A list of folders to ignore within the sign folder.
$nogo="[General_Images][Staff Photos]"; # A list of folders to ignore within the sign folder.
$staticsync_autotheme=true; # Automatically create themes based on the first and second levels of the sync folder structure.
# Allow unlimited theme levels to be created based on the folder structure. 
# Script will output a new $theme_category_levels number which must then be updated in config.php
$staticsync_folder_structure=false;
# Mapping extensions to resource types for sync'd files
# Format: staticsync_extension_mapping[resource_type]=array("extension 1","extension 2");
$staticsync_extension_mapping_default=1;
$staticsync_extension_mapping[3]=array("mov","3gp","avi","mpg","mp4","flv"); # Video
$staticsync_extension_mapping[4]=array("flv");
# Uncomment and set the next line to specify a category tree field to use to store the retieved path information for each file. The tree structure will be automatically modified as necessary to match the folder strucutre within the sync folder.
# $staticsync_mapped_category_tree=50;
# Should the generated resource title include the sync folder path?
$staticsync_title_includes_path=true;
# Should the sync'd resource files be 'ingested' i.e. moved into ResourceSpace's own filestore structure?
# In this scenario, the sync'd folder merely acts as an upload mechanism. If path to metadata mapping is used then this allows metadata to be extracted based on the file's location.
$staticsync_ingest=false;
#
# StaticSync Path to metadata mapping
# ------------------------
# It is possible to take path information and map selected parts of the path to metadata fields.
# For example, if you added a mapping for '/projects/' and specified that the second level should be 'extracted' means that 'ABC' would be extracted as metadata into the specified field if you added a file to '/projects/ABC/'
# Hence meaningful metadata can be specified by placing the resource files at suitable positions within the static
# folder heirarchy.
# Use the line below as an example. Repeat this for every mapping you wish to set up
# $staticsync_mapfolders[]=array
# (
# "match"=>"/projects/",
# "field"=>10,
# "level"=>2
# );
#
# Suffix to use for alternative files folder
# If staticsync finds a folder in the same directory as a file with the same name as a file but with this suffix appended, then files in the folder will be treated as alternative files for the give file.
# For example a folder/file structure might look like:
# /staticsync_folder/myfile.jpg
# /staticsync_folder/myfile.jpg_alternatives/alternative1.jpg
# /staticsync_folder/myfile.jpg_alternatives/alternative2.jpg
# /staticsync_folder/myfile.jpg_alternatives/alternative3.jpg
# NOTE: Alternative file processing only works when $staticsync_ingest is set to 'true'.
$staticsync_alternatives_suffix="_alternatives";

# if false, the system will always synthesize a title from the filename and path, even
# if an embedded title is found in the file. If true, the embedded title will be used.
$staticsync_prefer_embedded_title = true;

# End of StaticSync settings
# ------------------------------------------------------------------------------------------------------------------

And here is the output I receive:

Output from command /usr/bin/php /var/www/resourcespace/pages/tools/staticsync.php ..

		</select></table></table></table>
		<div style="border:1px solid black;font-family:verdana,arial,helvetica;position:absolute;top:100px;left:100px; background-color:white;width:400px;padding:20px;border-bottom-width:4px;border-right-width:4px;font-size:15px;color:black;">
		<table cellpadding=5 cellspacing=0><tr><td valign=middle><img src="http://resourcespace.wrtdesign.com/pages/admin/gfx/cherrybomb.gif" width="48" height="48"></td><td valign=middle align=left><span style="font-size:22px;">Sorry, an error has occurred.</span></td></tr></table>
		<p style="font-size:11px;color:black;margin-top:20px;">Please <a href="#" onClick="history.go(-1)">go back</a> and try something else.</p>
				<p style="font-size:11px;color:black;">You can <a href="http://resourcespace.wrtdesign.com/pages/check.php">check</a> your installation configuration.</p>
		<hr style="margin-top:20px;"><p style="font-size:11px;color:black;">/var/www/resourcespace/include/general.php line 2791: file_put_contents(/var/www/resourcespace/include/../filestore/tmp/process_locks/staticsync): failed to open stream: Permission denied</p>
				</div>

Advice is very welcome!

Regards,
Larry

David Dwiggins

unread,
Feb 16, 2012, 12:10:52 PM2/16/12
to resour...@googlegroups.com
It's because the user you're running staticsync under does not have write permission to the filestore. Staticsync needs to be able to write to the filestore in order to work.

-David

--
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To view this discussion on the web visit https://groups.google.com/d/msg/resourcespace/-/SFR4RTetmwAJ.
To post to this group, send email to resour...@googlegroups.com.
To unsubscribe from this group, send email to resourcespac...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/resourcespace?hl=en.

Larry G. Wapnitsky

unread,
Feb 16, 2012, 12:15:28 PM2/16/12
to resour...@googlegroups.com
update - works from the command line, but not when I run it from the Webmin Interface
--

Larry G. Wapnitsky

unread,
Feb 16, 2012, 2:22:02 PM2/16/12
to resour...@googlegroups.com
file is chmod 777, and www-data owns the folder - that's who I'm running the cron job as.

David Dwiggins

unread,
Feb 16, 2012, 2:24:34 PM2/16/12
to resour...@googlegroups.com
What about the files underneath filestore? You might need to use chmod -R to get them all.

777 is not ideal from a security standpoint -- better to run it from a user or group with specific privileges. But it should get the job done as long as all files and folders within it have this setting.

-DD

Larry G. Wapnitsky

unread,
Feb 16, 2012, 2:25:53 PM2/16/12
to resour...@googlegroups.com
all owned by www-data, but not 777'ed.  BTW - 777 is the recommendation from the install doc.  I know it's not the most secure and would like to lock it down further once I settle this.

Larry G. Wapnitsky

unread,
Feb 16, 2012, 2:26:48 PM2/16/12
to resour...@googlegroups.com
nevermind...cifs didn't automount my folder.


On 2/16/2012 2:24 PM, David Dwiggins wrote:
Reply all
Reply to author
Forward
0 new messages