wimleers / fileconveyor

File Conveyor is a daemon written in Python to detect, process and sync files. In particular, it's designed to sync files to CDNs. Amazon S3 and Rackspace Cloud Files, as well as any Origin Pull or (S)FTP Push CDN, are supported. Originally written for my bachelor thesis at Hasselt University in Belgium.
https://wimleers.com/fileconveyor
The Unlicense
340 stars 95 forks source link

Setting up s3 for pic files storage and post them on site via cloudfront URL #95

Open mapreferee opened 12 years ago

mapreferee commented 12 years ago

I want to push some of my static files (mainly pictures) to Amazon s3, then not all of my files should be put on one shared host provider. As a result, one server will support the pic files and another will support the web files. CDN fileconveyor sounds like wonderful solution for me.

Following the CDN installation in the install.txt and configuration steps in readme.txt, I typed the following command: uesrname $ python /opt/fileconveyor/code/arbitrator.py


but then the below message keeps showing in my ubuntu terminal: quickstart@qs10:~$ python /opt/fileconveyor/code/arbitrator.py 2011-10-15 10:17:08,273 - Arbitrator - WARNING - File Conveyor is initializing. 2011-10-15 10:17:08,306 - Arbitrator - WARNING - Loaded config file. 2011-10-15 10:17:40,607 - Arbitrator - ERROR - Could not start transporter 'cf'. Error: 'S3Error: Unable to provide secure connection through proxy'. 2011-10-15 10:17:54,651 - Arbitrator - ERROR - Could not start transporter 's3'. Error: 'S3Error: Unable to provide secure connection through proxy'. 2011-10-15 10:17:54,915 - Arbitrator - ERROR - Server connection tests: could not connect with 2 servers. 2011-10-15 10:17:55,236 - Arbitrator - WARNING - File Conveyor has restarted itself!

xxxx

For reference about configure.xml in /opt/fileconveyor/code, below is its details: “<“!-- Sources  “<“sources ignoredDirs="CVS:.svn"“>“ “<“source name="drupal" scanPath="/home/quickstart/Desktop/websites/example.dev" documentRoot="/home/quickstart/Desktop/websites" basePath="/example.dev/" /”>“ “<“source name="downloads" scanPath="/home/quickstart/Downloads" /”>“ “<“/sources”>““<“

“<“!-- Servers --”>“ “<“servers”>“ “<“server name="origin pull cdn" transporter="cf"“>“ “<“bucket_name”>“example”<“/bucket_name”>“ “<“access_key_id”>“xxxxxxxxxxxxx”<“/access_key_id”>“ “<“secret_access_key”>“xxxxxxxxxxxxx”<“/secret_access_key”>“ “<“distro_domain_name”>“example.mywebsite.com”<“/distro_domain_name”>“ “<“/server”>“ “<“server name="ftp push cdn" transporter="s3" maxConnections="5"“>“ “<“bucket_name”>“example”<“/bucket_name”>“ “<“access_key_id”>“xxxxxxxxxxxxxxx”<“/access_key_id”>“ “<“secret_access_key”>“xxxxxxxxxxxxxxxxxxxxx”<“/secret_access_key”>“ “<“/server”>“ “<“/servers”>“

About configure.xml in /mywebsite/sites/all/modules/cdn/, below is its details: “<“!-- Sources --”>“ “<“sources”>“ “<“source name="drupal" scanPath="/home/quickstart/Desktop/websites/example.dev" documentRoot="/home/quickstart/Desktop/websites" basePath="/example.dev/" /”>“ “<“/sources”>“

“<“!-- Servers --”>“ “<“servers”>“ “<“server name="origin pull cdn" transporter="cf"“>“ “<“bucket_name”>“example”<“/bucket_name”>“ “<“access_key_id”>“xxxxxxxxxxxxx”<“/access_key_id”>“ “<“secret_access_key”>“xxxxxxxxxxxxx”<“/secret_access_key”>“ “<“distro_domain_name”>“example.mywebsite.com”<“/distro_domain_name”>“ “<“/server”>“ “<“server name="ftp push cdn" transporter="s3" maxConnections="5"“>“ “<“bucket_name”>“example”<“/bucket_name”>“ “<“access_key_id”>“xxxxxxxxxxxxxxx”<“/access_key_id”>“ “<“secret_access_key”>“xxxxxxxxxxxxxxxxxxxxx”<“/secret_access_key”>“ “<“/server”>“ “<“/servers”>“

Any help much appreciated. I know this can work! Really hope this CDN can work for me too as its features are very handy and useful.

mapreferee commented 12 years ago

I found the error messages pop up because of the following code:

def __create_transporter(self, server): """create a transporter for the given server"""

    transporter_name = self.config.servers[server]["transporter"]
    settings = self.config.servers[server]["settings"]

....................

    # Get a reference to that class.
    module = __import__(transporter_modulename, globals(), locals(), [transporter_classname])
    transporter_class = getattr(module, transporter_classname)

    # Attempt to create an instance of the transporter.
    try:
        transporter = transporter_class(settings, self.transporter_callback, self.transporter_error_callback, "Arbitrator")
    except ConnectionError, e:
        self.logger.error("Could not start transporter '%s'. Error: '%s'." % (transporter_name, e))
        return False
    else:
        self.logger.warning("Created '%s' transporter for the '%s' server." % (transporter_name, server))

    return transporter

The error message S3Error comes from the argument e next to the self.logger.error The error might be caused by Settings.php, self.transporter_callback, self.transporter_error_callback or Arbitrator

Keep working on it. Any help appreciated

mapreferee commented 12 years ago

I found that this is very likely not related to the config.xml. It is something about the place where I configure this file. Since I tried to configure this file on Ubuntu in Virtual Box. It makes sense I got this message. But just wonder if it is possible to configure this in such an environment too.

Any help appreciated. Thanks.

paperscissors commented 12 years ago

i keep running into this same problem with S3. from what i can tell i think it doesn't like something in the config.xml file circling around the S3 transporter.

there's a big lack of documentation surrounding S3 transporters, but what I have seen mentions a "bucketprefix" which, having used S3 for over a year now with various APIs confuses me, because i've never heard of such a thing before.