[Mongrel] Win32 service - Errno::EINVAL (Invalid argument) when uploading image file

Herryanto Siatono herryanto at gmail.com
Thu Apr 26 00:49:05 EDT 2007

Hi guys,

I'm facing an error trying to run my app as mongrel_service, hope those who
have faced similar issue can help to shed some lights. 

The app was fine when running from console, but when running it as a
service, it failed when I try to upload 'image file', it has no issue
uploading other types of files. 

mongrel (1.0.1,
mongrel_service (0.3.1)
rmagick (1.13.0)
ruby (1.8.5)
rails (1.2.3)
Tested on Windows XP and Windows 2003 server

Error Message:
Errno::EINVAL (Invalid argument):
    e:/ruby/lib/ruby/1.8/base64.rb:114:in `write'
    e:/ruby/lib/ruby/1.8/base64.rb:114:in `print'
    e:/ruby/lib/ruby/1.8/base64.rb:114:in `b64encode'
    e:/ruby/lib/ruby/1.8/base64.rb:113:in `scan'
    e:/ruby/lib/ruby/1.8/base64.rb:113:in `b64encode'
    /app/models/asset.rb:110:in `with_image'
    /app/models/asset.rb:100:in `crop_image_size'
    /vendor/rails/activerecord/lib/active_record/callbacks.rb:337:in `send'
    /vendor/rails/activerecord/lib/active_record/callbacks.rb:334:in `each'

tabase_statements.rb:59:in `transaction'
    /vendor/rails/activerecord/lib/active_record/query_cache.rb:66:in `send'

 "commit"=>"Upload file",

Service command:
"e:/ruby/bin/mongrel_service.exe" single -e production -p 4000 -a -l
"log/mongrel.log" -P "log/mongrel.pid" -c "D:/rubywork/[appname]" -t 0 -r
"public" -n 1024

Not sure if it was access right issue as service runs as System account, but
I tried running the service in the console yet I'm getting the same error

Service console command:
> mongrel console single -e production -p 4000 -l -c "D:/rubywork/[appname]"

No error message shown on the console, log/mongrel.log file was not there as

Thanks in advance.


Herryanto Siatono

More information about the Mongrel-users mailing list