#16 ✓resolved
Luca Guidi

Cache write error on Ubuntu 8.04

Reported by Luca Guidi | September 30th, 2008 @ 10:08 AM | in 0.2.x

When an user tries to install a plugin, Sashimi fails to write to cache with the following error:


Invalid cross-device link - /tmp/.plugins.7147.0 or .plugins

The problem seems to affect only Ubuntu 8.04 users.

I'm not sure if it's a Sashimi bug, because I use an ActiveSupport utility for write into the cache.

In order to isolate the problem, please check the source code and try it without Sashimi. http://github.com/jodosha/sashim...

Comments and changes to this ticket

  • Luca Guidi

    Luca Guidi September 30th, 2008 @ 10:56 AM

    Ok, I tried with a virtualized Ubuntu 8.04.1 (Parallels Desktop), and both with ActiveSupport 2.1.0 and 2.1.1, it works for me.

    I also tried with irb to use File#atomic_write, and everything it's ok.

  • max_dev

    max_dev September 30th, 2008 @ 03:44 PM

    Is because the temp directory is not on the same filesystem as the file trying to write (virtualized is on the same, I suppose):

    http://api.rubyonrails.com/class...

    I think a:

    File.atomic_write("uno.txt", "./") do |file|

    file.write("hello")
    
    

    end

    specifying a explicit different temporary directory (in the same filesystem) may solve the issue

  • Luca Guidi

    Luca Guidi September 30th, 2008 @ 04:37 PM

    Theoretically, Dir#tmpdir should return the first writeable directory declared in certain env variables. If none of those directories are available it should return the current working one. http://www.ruby-doc.org/core/cla...

    I applied your fix, I don't care about the tmp dir, for me it's OK to perform all the operations inside ~/.rails/plugins.

    I build and attached the gem, please can you download, install and try if it works?

    Thank you!

  • Luca Guidi

    Luca Guidi September 30th, 2008 @ 04:38 PM

    • State changed from “new” to “resolved”

    (from [8e28464043f09c42007e79edead46f3b0d5cc851]) Force File#atomic_write to use the current directory as temp path. [#16 state:resolved] http://github.com/jodosha/sashim...

  • max_dev

    max_dev September 30th, 2008 @ 07:13 PM

    Deleted and installed jodosha-sashimi:

    gem install jodosha-sashimi --source=http://gems.github.com

    then:

    sashimi install git://github.com/jodosha/click-to-globalize.git

    Nothing changed in code:

      File.atomic_write(cache_file) do |file|
        file.write(plugins.to_yaml)
      end
    
    

    same error.

  • Luca Guidi

    Luca Guidi September 30th, 2008 @ 11:01 PM

    You should install the attached gem with:

    
    (sudo) gem install --local sashimi-0.2.1.gem
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Sashimi is a system wide repository to handle Rails plugins as gems

People watching this ticket

Attachments

Tags

Referenced by

Pages