af not playing well with symlinks #3

sodiumjoe opened this Issue Jul 20, 2012 · 8 comments


None yet

5 participants


When I try to upload an app with symlinks generated by pip, I get:

$ af update flask-example
Uploading Application:
different prefix: "" and "/Users/joe/Work/flask-example"
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:730:in `relative_path_from'
/Library/Ruby/Gems/1.8/gems/af- `check_unreachable_links'
/Library/Ruby/Gems/1.8/gems/af- `each'
/Library/Ruby/Gems/1.8/gems/af- `check_unreachable_links'
/Library/Ruby/Gems/1.8/gems/af- `upload_app_bits'
/Library/Ruby/Gems/1.8/gems/af- `chdir'
/Library/Ruby/Gems/1.8/gems/af- `upload_app_bits'
/Library/Ruby/Gems/1.8/gems/af- `update'
/Library/Ruby/Gems/1.8/gems/af- `send'
/Library/Ruby/Gems/1.8/gems/af- `run'
/Library/Ruby/Gems/1.8/gems/af- `run'
/usr/bin/af:19:in `load'

But, then when I "cp -r" the directory into a brand new one copying the contents of the symlinked directories into the new one, it uploads fine.


you're right, it doesn't play well with symlinks. I believe this is by design.

/cc @jvoorhis @lhitchon can you confirm?


Yes, that's right.
It does not allow symlinks that point outside of the project directory.
And the 'cp -r' copies the contents of the files instead of making new symlinks, so the new directory you created should work.


I see. Then, since virtualenv uses symlinks, should we not recommend using it, or should I look for a way to tell virtualenv to not use symlinks?


I don't know much about virtualenv.
But symlinks are okay as long as they don't point outside the project root directory.
It's 'external' links that af will not allow


Ok, this is expected behavior. Current workaround: create a separate directory outside of the app directory for virtualenv, and activate it. Thanks @lhitchon !

@sodiumjoe sodiumjoe closed this Jul 25, 2012

Just ran into this myself with a virtualenv. This kind of directory structure is very typical for Django apps::

   /env <--- virtualenv directory

But if you use this with AppFog then it blows up with the rather vague different prefix error since the virtualenv has lots of symlinks (to the system Python libraries in it).

Is there a way to have files in your app directory which af will just ignore? Alternatively, might it be useful to special case the virtualenv case? It is fairly easy to divine that a directory is a virtualenv by its contents. (/bin subdir with activate and deactivate scripts ought to be fairly foolproof)

Any interest in such a patch? Or alternatively an .afignore file?


I don's use any symlink, but I still have the same error. Can somebody tell me how to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment