S3Sync.net

General Category => Closed Bugs => Topic started by: ryantate on February 22, 2007, 02:10:41 PM



Title: NoMethodError when uploading dir instead of dir contents
Post by: ryantate on February 22, 2007, 02:10:41 PM
I think I hit a new bug in 1.1.0

This works fine:

Quote
ruby -I s3sync s3sync/s3sync.rb -r --ssl --delete testUploads/ myBucket:testUploads

But this produces an error:

Quote
ruby -I s3sync s3sync/s3sync.rb -r --ssl --delete testUploads myBucket:testUploadsParent

Notice the difference is the lack of trailing slash on the source dir, indicating I want the actual dir itself, not just its contents, uploaded to the destination dir.

The error, the sole output of the command, is:

Quote
s3sync/s3sync.rb:124:in `main': undefined method `[]' for nil:NilClass (NoMethodError)
        from s3sync/s3sync.rb:681

Not sure the cause of this. But if I replace my old version (1.0.13) of s3sync for the new one, everything works fine.


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: ferrix on February 22, 2007, 04:08:47 PM
Will take a look!


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: ferrix on February 22, 2007, 08:28:26 PM
Augh.. am I ever an idiot  ::)

Fix coming.


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: ryantate on February 23, 2007, 02:03:04 PM
No worries! Glad to see so many new features in the new version!


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: grempe on March 07, 2007, 03:08:21 PM
I am also seeing a similar error with the latest build:

s3sync.rb:500:in `updateFrom': undefined method `closed?' for nil:NilClass (NoMethodError)
        from s3sync.rb:387:in `main'
        from s3sync.rb:690

I am running s3sync from a cron job with a command like this:

/usr/local/bin/ruby s3sync.rb -r --ssl --delete /home/backups/ bucket.name:/bucket.folder.name/backups

Any ideas?


PS - It would be awesome if you could put this all in a subversion repos so we could keep the code up to date more easily.  Or even better you could package it as a Ruby Gem!  (Try this for easy gem goodness! : http://drnicwilliams.com/2006/10/11/generating-new-gems/ ).


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: ferrix on March 07, 2007, 05:35:16 PM
I ran into this too this morning and quickly fixed it.  Try getting the tarball again and see if it's better for you as well.  I didn't even up the version for this, which is naughty I know.  But I'm supa busy today.


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: lowflyinghawk on March 08, 2007, 06:50:21 AM
you didn't up the version? shame on you! take yourself to the woodshed!

missing one of these points out how difficult it is be sure all your code is working.  after a long series of changes, all of which worked as far as I could tell, I tried listing an empty bucket. boing! wrong number of arguments error in a logging function!  I thought I'd covered them all by manually editing the code and causing the error side of conditionals to execute, but I was wrong about that.


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: ferrix on March 08, 2007, 08:09:06 AM
This is the secret (sshhh don't tell) to why I like to foster the s3sync community and don't overtly ask anything in return.  It is really hard to catch all my own bugs  ;D


Title: Re: NoMethodError when uploading dir instead of dir contents
Post by: lowflyinghawk on March 09, 2007, 07:02:43 AM
yes, the perversity of users is well known to be unbounded, that's why big projects use betas (of course this doesn't include S3, they just roll it out and pray)  ;D