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
341 stars 95 forks source link

Bug: a <rule> must always have a <filter> #140

Open oba11 opened 11 years ago

oba11 commented 11 years ago

The monitor works but I keep getting "Filter queue: dropped '/static/image.live/oba.jpg' because it doesn't match any rules. I just want to sync all the files in my root folder to the corresponding folders in the container.

Looking forward to a solution. Thanks

LogFile

2013-02-22 23:03:12,423 - Arbitrator.FSMonitor      - INFO     - Detected 'CREATED' event for '/static/image.live/oba.jpg' through polling (for monitored path '/static/image.live').
2013-02-22 23:03:12,608 - Arbitrator                - INFO     - Discover queue -> pipeline queue: '/static/image.live/oba.jpg'.
2013-02-22 23:03:12,613 - Arbitrator                - INFO     - Pipeline queue -> filter queue: '/static/image.live/oba.jpg'.
2013-02-22 23:03:12,616 - Arbitrator                - INFO     - Filter queue: dropped '/static/image.live/oba.jpg' because it doesn't match any rules.

Config File

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <!-- Sources -->
  <sources ignoredDirs="css:js:images">
    <source name="mycdn" scanPath="/static/image.live" documentRoot="/static/image.live" basePath="/" />
  </sources>

  <!-- Servers -->
  <servers>
    <server name="Rackspace Cloud Files" transporter="cloudfiles">
      <username>username</username>
      <api_key>secretkey</api_key>
      <container>image.live</container>
    </server>
  </servers>

  <!-- Rules -->
  <rules>
    <rule for="default" label="Default Rule">
      <destinations>
        <destination server="Rackspace Cloud Files" path="" />
      </destinations>
    </rule>
  </rules>
</config>
dbswebsite commented 11 years ago

Did you ever find a solution to this?

wimleers commented 11 years ago

Hah! The current code at arbitrator.py/__process_filter_queue() assumes there's going to be at least one filter. That function should be refactored to allow for no filter rules!

For now, you can fix it by changing:

    <rule for="default" label="Default Rule">
      <destinations>
        <destination server="Rackspace Cloud Files" path="" />
      </destinations>
    </rule>

to:

    <rule for="default" label="Default Rule">
      <destinations>
        <destination server="Rackspace Cloud Files" path="" />
      </destinations>
      <filter>
        <pattern>.*</pattern>
      </filter>
    </rule>

Which essentially says "anything is allowed".