Forum: Mongrel file access with mongrel running as windows service

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F12532c1224ff2ab2260e853258deddb?d=identicon&s=25 neongrau __ (neongrau)
on 2007-11-07 15:01
(Received via mailing list)
i have an archive of documents (word, excel, jpeg, png, gif...)
residing on a network share that is accessed via send_file.

when running mongrel on the command line the files are properly
delivered.
with mongrel running as a service they don't.

now normally i would think that should be fixable by configuring the
service to run under a user that can read the files....

but i've already tried that without success.

running the service as system or administrator or the user i'm using
for development (the same user i run the mongrel on command line) does
_NOT_ help. so i can't figure out how to get this to work.

development or production mode also doesn't make a difference.

from what i've seen so far this generally applies to any File IO access.

could this be a bug in the mongrel service implementation?
94952ae2519ff1b9b5d982863bcb37f3?d=identicon&s=25 David Vrensk (Guest)
on 2007-11-07 15:50
(Received via mailing list)
On Nov 7, 2007 3:01 PM, gmail <neongrau@gmail.com> wrote:

> i have an archive of documents (word, excel, jpeg, png, gif...)
> residing on a network share that is accessed via send_file.
>
> when running mongrel on the command line the files are properly
> delivered.
> with mongrel running as a service they don't.


Try running "net use" inside the process to see if the network share is
mounted at all.  This sounds like the typical Windows/web problem where
the
operator assumes that everybody sees the same shares that she sees in
her
session.  In reality, network shares are mounted per login session.  Two
users can be logged in on the the same Windows server and have different
shares available on Z:, which is clever, but also sort of confusing.
What
is even more confusing is that you may be logged on as "user1" and have
something mapped to Z:, but the service running as user1 has nothing on
Z: –
it needs to create its own mappings.

Let us know if this helps.

/David
F12532c1224ff2ab2260e853258deddb?d=identicon&s=25 neongrau __ (neongrau)
on 2007-11-07 16:13
(Received via mailing list)
yes that helped!

i just needed to switch the drive letter with the UNC path :)

thanks for pointing that out.
years of using windows but never thought it worked that way


Am 07.11.2007 um 15:48 schrieb David Vrensk:
F12532c1224ff2ab2260e853258deddb?d=identicon&s=25 neongrau __ (neongrau)
on 2007-11-07 16:23
(Received via mailing list)
yes that helped!

i just needed to switch the drive letter with the UNC path :)

thanks for pointing that out.
years of using windows but never thought it worked that way


Am 07.11.2007 um 15:48 schrieb David Vrensk:
F12532c1224ff2ab2260e853258deddb?d=identicon&s=25 neongrau __ (neongrau)
on 2007-11-07 16:29
(Received via mailing list)
sorry that wasn't posted "anonymously" on purpose.
i just set up my gmail account with imap in apple mail last night and
didn't even noticed it put gmail in the sender name. until i sent the
reply.


Am 07.11.2007 um 15:48 schrieb David Vrensk:
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-08-17 15:54
David Vrensk wrote:
> On Nov 7, 2007 3:01 PM, gmail <neongrau@gmail.com> wrote:
>
>> i have an archive of documents (word, excel, jpeg, png, gif...)
>> residing on a network share that is accessed via send_file.
>>
>> when running mongrel on the command line the files are properly
>> delivered.
>> with mongrel running as a service they don't.
>
>
> Try running "net use" inside the process to see if the network share is
> mounted at all.  This sounds like the typical Windows/web problem where
> the
> operator assumes that everybody sees the same shares that she sees in
> her
> session.  In reality, network shares are mounted per login session.  Two
> users can be logged in on the the same Windows server and have different
> shares available on Z:, which is clever, but also sort of confusing.
> What
> is even more confusing is that you may be logged on as "user1" and have
> something mapped to Z:, but the service running as user1 has nothing on
> Z: –
> it needs to create its own mappings.
>
> Let us know if this helps.
>
> /David

David could you explain it more i think i have same sort of problem
what i am doing is.
i created a web application using instant rails,i having rails
2.2.2,mysql database,mongrel running as a server,
i used mysql database to store the different property of files and i am
plcing actual file(phsical file) on samba server.now i run my it as
application ,everthing is fine but soon i run my application as windows
service  i am getting this problem

No such file or directory - Z:/streams/Texture.bmp
Z: is drive letter
here i am trying to upload Texture.bmp file to samba means to Z:/streams
any help ..........
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2010-08-17 16:03
(Received via mailing list)
On Tue, Aug 17, 2010 at 10:54 AM, Amit Tomar <lists@ruby-forum.com>
wrote:
> No such file or directory - Z:/streams/Texture.bmp
> Z: is drive letter
> here i am trying to upload Texture.bmp file to samba means to Z:/streams
> any help ..........
>

Unless you're running the mongrel service as the same user, the mapped
network drives are not available.

Either you use the full network path (\\SERVER\PATH) or you run the
service as the user that defines the mapped network drives.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-08-17 16:08
Luis Lavena wrote:
> On Tue, Aug 17, 2010 at 10:54 AM, Amit Tomar <lists@ruby-forum.com>
> wrote:
>> No such file or directory - Z:/streams/Texture.bmp
>> Z: is drive letter
>> here i am trying to upload Texture.bmp file to samba means to Z:/streams
>> any help ..........
>>
>
> Unless you're running the mongrel service as the same user, the mapped
> network drives are not available.
>
> Either you use the full network path (\\SERVER\PATH) or you run the
> service as the user that defines the mapped network drives.
> --
> Luis Lavena
> AREA 17
> -
> Perfection in design is achieved not when there is nothing more to add,
> but rather when there is nothing more to take away.
> Antoine de Saint-Exupé²¹

Luis
i tried to set full network path
but not successed and how do i run the service under the user that
defines the mapped network drives.
> --
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2010-08-17 16:25
(Received via mailing list)
On Tue, Aug 17, 2010 at 11:08 AM, Amit Tomar <lists@ruby-forum.com>
wrote:
>
> Luis
> i tried to set full network path
> but not successed and how do i run the service under the user that
> defines the mapped network drives.

You will need to access the Services definition and under properties
select Run as user. You will need to provide the password too. (all
this under administrative tools, things may vary between windows
versions).

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-08-17 17:08
Luis Lavena wrote:
> On Tue, Aug 17, 2010 at 11:08 AM, Amit Tomar <lists@ruby-forum.com>
> wrote:
>>
>> Luis
>> i tried to set full network path
>> but not successed and how do i run the service under the user that
>> defines the mapped network drives.
>
> You will need to access the Services definition and under properties
> select Run as user. You will need to provide the password too. (all
> this under administrative tools, things may vary between windows
> versions).
>
> --
> Luis Lavena
> AREA 17
> -
> Perfection in design is achieved not when there is nothing more to add,
> but rather when there is nothing more to take away.
> Antoine de Saint-Exupé²¹

r u saying i ahve to run my service under netwrok service and i would
like  to konw how i run my service under netwrok service??
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2010-08-17 17:27
(Received via mailing list)
On Tue, Aug 17, 2010 at 12:08 PM, Amit Tomar <lists@ruby-forum.com>
wrote:
>
> r u saying i ahve to run my service under netwrok service and i would
> like  to konw how i run my service under netwrok service??

No, I'm saying that you need to run your service under a user account
that defines those mapped network drives. Since network mappings (Z:,
W:, etc) are dependent of the user, needs to be run as that particular
user.

You need to change those settings for that particular service under
the "Services" manager in Administrative Tools (control panel).

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-08-18 14:47
Luis Lavena wrote:
> On Tue, Aug 17, 2010 at 12:08 PM, Amit Tomar <lists@ruby-forum.com>
> wrote:
>>
>> r u saying i ahve to run my service under netwrok service and i would
>> like ?to konw how i run my service under netwrok service??
>
> No, I'm saying that you need to run your service under a user account
> that defines those mapped network drives. Since network mappings (Z:,
> W:, etc) are dependent of the user, needs to be run as that particular
> user.
>
> You need to change those settings for that particular service under
> the "Services" manager in Administrative Tools (control panel).
>
> --
> Luis Lavena
> AREA 17
> -
> Perfection in design is achieved not when there is nothing more to add,
> but rather when there is nothing more to take away.
> Antoine de Saint-Exupé²¹

LUIS
i am not getting error like
Permission denied - //Z/:streams/al00_96000.aac
what should i do and i am also running service as a particular user
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2010-08-18 19:04
(Received via mailing list)
On Wed, Aug 18, 2010 at 9:47 AM, Amit Tomar <lists@ruby-forum.com>
wrote:
>
> LUIS
> i am not getting error like
> Permission denied - //Z/:streams/al00_96000.aac
> what should i do and i am also running service as a particular user

I'm having problems understanding your english.

Mapped network drives do not start with //, they are normal network
letters:

C:\Users\Luis>net view
Server Name            Remark

-------------------------------------------------------------------------------
\\KEORE

C:\Users\Luis>net view \\KEORE
Shared resources at \\KEORE

Share name  Type  Used as  Comment
-------------------------------------------------------------------------------
Users       Disk

C:\Users\Luis>net use * \\KEORE\Users
Drive Z: is now connected to \\KEORE\Users.

The command completed successfully.

C:\Users\Luis>irb
irb(main):001:0> require 'fileutils'
=> true
irb(main):002:0> FileUtils.touch "Z://foo.txt"
Errno::EACCES: Permission denied - Z://foo.txt
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`initialize'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`open'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`touch'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`each'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`touch'
        from (irb):2

It is clear I don't have permission to do that, but:

irb(main):003:0> FileUtils.touch "Z://Luis/foo.txt"
=> ["Z://Luis/foo.txt"]

I do.

Also:

irb(main):004:0> FileUtils.touch "//Z://Luis/bar.txt"
Errno::ENOENT: No such file or directory - //Z://Luis/bar.txt
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`initialize'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`open'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1034:in
`touch'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`each'
        from
C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p302-i386-mingw32/lib/ruby/1.8/fileutils.rb:1028:in
`touch'
        from (irb):4

it is clear that // should not prepend the drive letter, but instead:

irb(main):005:0> FileUtils.touch "//KEORE/Users/Luis/bar.txt"
=> ["//KEORE/Users/Luis/bar.txt"]

I hope this explains a bit better what I'm talking about.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-08-20 14:12
Thanks my friend...
i am able to figure out my problem ...
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-08-20 15:31
Luis I tried to upload a file of size 324mb but something strange
happened
i'm able to upload the file but still i'm getting error
 Invalid argument -
//192.122.227.53/Smar/streams2/D1_monsters_3_720x480_422i_SP_5Mbps_30fps_657frames.yuv
but when i checked the location(//192.122.227.53/Smar/streams2) file was
there
what could be the reason ??
E7cff3cfd41c495e1012227d7dc24202?d=identicon&s=25 Luis Lavena (luislavena)
on 2010-08-20 16:27
(Received via mailing list)
On Fri, Aug 20, 2010 at 10:31 AM, Amit Tomar <lists@ruby-forum.com>
wrote:
> Luis I tried to upload a file of size 324mb but something strange
> happened
> i'm able to upload the file but still i'm getting error
>  Invalid argument -
> //192.122.227.53/Smar/streams2/D1_monsters_3_720x480_422i_SP_5Mbps_30fps_657frames.yuv
> but when i checked the location(//192.122.227.53/Smar/streams2) file was
> there
> what could be the reason ??

I have no idea where are you receiving the 'invalid argument' error.

It is extrematelly important than when you report an error, provide
enough details and precision about it, more precisely, the full error
messages and backtraces.

We can't replicate or provide you help if you skim it and provide
vague information.

Help us help you.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-08-27 15:46
Luis Lavena wrote:
> On Fri, Aug 20, 2010 at 10:31 AM, Amit Tomar <lists@ruby-forum.com>
> wrote:
>> Luis I tried to upload a file of size 324mb but something strange
>> happened
>> i'm able to upload the file but still i'm getting error
>> ?Invalid argument -
>> //192.122.227.53/Smar/streams2/D1_monsters_3_720x480_422i_SP_5Mbps_30fps_657frames.yuv
>> but when i checked the location(//192.122.227.53/Smar/streams2) file was
>> there
>> what could be the reason ??
>
> I have no idea where are you receiving the 'invalid argument' error.
>
> It is extrematelly important than when you report an error, provide
> enough details and precision about it, more precisely, the full error
> messages and backtraces.
>
> We can't replicate or provide you help if you skim it and provide
> vague information.
>
> Help us help you.
> --
> Luis Lavena
> AREA 17
> -
> Perfection in design is achieved not when there is nothing more to add,
> but rather when there is nothing more to take away.
> Antoine de Saint-Exupé²¹



 i don't know how to ask this question because am new to
rails.
but i want to know to is which part of code  sumit_tag will take  you
means
after execution of sumit_tag where control of programme goes??
This topic is locked and can not be replied to.