airtime-import --watch-add ERROR: "is not a valid directory"
  • Dear Airtime Support,
     
    I'm trying to get daily episodes of Democracy Now loaded into Airtime 1.9.5 running on Ubuntu desktop 10.04.
    A podget cron job downloads the files to ~/DemocracyNow, and I'm trying to add the media to the library with
    the airtime-import script.
     
    I tried:
    $ airtime-import --watch-add /home/soundfm/DemocracyNow
    and got this error:
    Adding a watched folder failed: '/home/soundfm/DemocracyNow' is not a valid directory.
    I can't add any directory in ~/
    Should the directory be in a special path? Did I do something wrong with permissions?
    Is this a bug?

    The same error was mentioned here:
    http://forum.sourcefabric.org/discussion/12731/media-monitor-and-sftp-uploads-problem/p1


    If this is a 1.9 bug, we're planning on upgrading to Airtime 2 soon anyway.

    Thanks!
    Peter
    Post edited by Peter Higdon at 2012-04-03 16:10:34
  • 13 Comments sorted by
  • Hi,

    Currently we require any watched folder to be readable by the webserver whose login is www-data.

    A quick fix would to put www-data user in the same group as your soundfm user.

    Type:
    sudo adduser www-data soundfm
    from the terminal.
    Airtime Pro Hosting: http://airtime.pro
  • Thanks Martin.
    I ran the command, and www-data is a member of soundfm, but I still got the same error.
  • Try running this on the directory

    sudo chmod g+rX /path/to/watched/folder
    Airtime Pro Hosting: http://airtime.pro
  • I ran the command, and it still gives the same error
    permissions on the directory are: drwxr-xr-x
  • Hmm, we need more comprehensive error messages for situations like this. I looked through the source to see how this could happen. One of the reasons this error can happen is that the directory you're trying to watch already has its parent/ancestor directory being watched. Is this the case?

    Airtime Pro Hosting: http://airtime.pro
  • There are no folders being watched right now.

    soundfm@tower:~$ airtime-import --watch-list
    No watch folders found

  • I had a similar problem with 2.0.1, Peter. To get it to work, I had to change the owner and group of the directory to www-data and then restart the media monitor service (sudo service airtime-media-monitor restart).
  • Thanks Wade. It didn't work.

    terminal output:
    soundfm@tower:~$ ls -l
    ...
    drwxr-xr-x 2 www-data  soundfm       4096 2012-04-15 11:30 DemocracyNow
    ....
    soundfm@tower:~$ sudo service airtime-media-monitor restart
    Restarting Airtime Media Monitor: Done.
    soundfm@tower:~$ sudo airtime-import --watch-add /home/soundfm/DemocracyNow Adding a watched folder failed: '/home/soundfm/DemocracyNow' is not a valid directory.


  • It shouldn't matter, but I see (from your response above) that the group is still soundfm. Did you try changing the group to www-data also?
  • @Peter

    I realize the command I gave you had a small problem. Please run it again with this slight modification:

    sudo chmod -R g+rX /path/to/watched/folder
    Airtime Pro Hosting: http://airtime.pro
  • I know this is an old thread but I'm getting the same issue here on 2.2.0

    Have been through all of the above

    /media/Box/ works fine
    /media/Box/Music/ doesn't work
    /media/Box/Music/70s/ doesn't work.

    Any suggestions? My music library is accessed via various pieces of software so I really don't want to have to start moving everything around (just because I don't want AirTime to access the entire /Music/ directory)

    Have also been through the instructions on http://forum.sourcefabric.org/discussion/14153/airtime-import-watch-directory/p1

    Cheers
    Iain

  • Reply to @Iain+Broughton:

    We were not even aware this was a bug in previous version of Airtime. We will try to recreate this issue.
    Airtime Pro Hosting: http://airtime.pro
  • I just posted something along these lines http://forum.sourcefabric.org/discussion/14777/airtime-2.2.0-media-watch

    Anyway here is some output...
    sudo airtime-import --watch-list
    No watch folders found

    server1:~$ sudo airtime-import --watch-add /Music/2013
    Adding a watched folder failed: '/Music/2013/' is nested within existing watched directory: '/Music/'

    server1:~$ sudo airtime-import --storage-dir-get
    /Music/