dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: Operating system error code 3(The system cannot find the path specified.).

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    31

    Operating system error code 3(The system cannot find the path specified.).

    I have a page that I've built that does a bulk insert from a file that is stored on a web server. When the user clicks on the submit button, they receive the following error:

    Operating system error code 3(The system cannot find the path specified.).

    I have made sure that the SQL server has admin rights to the path of the folder that has the file uploaded to it (I even added the specific SQL server user to the admin rights) and it still won't work. The SQL server is 2000 and the web server is Windows Server 2003. Any ideas as to what may be causing this? I've read several different posts on several different forums and it seems that the consensus has been that it's a permissions issue. I think that with all that I've done, that the permissions are set up correctly but I may be wrong.

    Thank you

    Doug

  2. #2
    Join Date
    Sep 2007
    Posts
    86
    It sounds like your permissions aren't right as you suspect. I think you are setting the wrong permissions though, at least that is how I am interpreting your post.

    It sounds like you have the following scenario:

    1. User uploads a file from a webpage to the webserver
    2. On the server the webpage then performs a bulk insert into SQL server from the file that was uploaded


    If this is the case and you are getting the error on the web page then the permissions issue lies with the account your webpage is running under. The easiest way to troubleshoot this would be to run your page under the debugger and catch the error, when you do examine the path it is trying to find and ensure it is valid. If so, then you need to set the permissions for the user account that IIS ( or more correctly the app-pool) is running under to have permissios to the path.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  3. #3
    Join Date
    Apr 2009
    Posts
    31

    permissions

    J,

    What I did this morning was to wipe the slate clean as far as permissions go and create a new user on the web server in question. I then made sure with aspnet_regiis that the new user had permissions to execute with asp.net. I then made sure that the default application pool is using the newly created account and I'm still receiving the error. I'm not sure what I'm missing, but I'm obviously missing something.

  4. #4
    Join Date
    Apr 2009
    Posts
    31
    John,

    Ok you were right about the crlf at the end of line 3. I edited that and that works fine now but it appears that the data is being double inserted. Can you see as to why that would be?

  5. #5
    Join Date
    Sep 2007
    Posts
    86
    Are you able to attach the debugger and see the path to confirm it is correct? Another tool you could use is FileMon. This would allow you to see the file access and the user/process that is trying to access it.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  6. #6
    Join Date
    Apr 2009
    Posts
    31

    Debugging

    I do have the following lines in my code:

    DebugLabel.Text = SavePath
    DebugLabel.Text = DebugLabel.Text + "<br />"

    and I'm seeing that it is the correct path.

  7. #7
    Join Date
    Sep 2007
    Posts
    86
    Then I would use FileMon to confirm the user that is trying to access the file:

    http://technet.microsoft.com/en-us/s.../bb896642.aspx
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  8. #8
    Join Date
    Apr 2009
    Posts
    31

    Filemon

    john,

    Since I've never used filemon before, I'm not really sure what I should be looking for here but I see that there are some path not found errors with csrss.exe. What should I be looking for with the filemon log?

  9. #9
    Join Date
    Sep 2007
    Posts
    86
    The easiest thing is to focus on either the process you believe is trying to access the file and limit to only information from that process or on the folder/file that it is trying to acesss.

    So set a filter to either filter by "process Name is XXX" or "Path begins with XXX" and then look for your error.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  10. #10
    Join Date
    Apr 2009
    Posts
    31

    Filemon

    I've taken a look through my filtered results and don't see anything on the server side that's showing me a username/pwd of the process that's trying to access the file. The process should be default.aspx.vb as that's where the page should be trying to initialize the sql bulk insert. As I said, I see the csrss.exe but again, I'm not seeing a username/pwd in there either.

  11. #11
    Join Date
    Sep 2007
    Posts
    86
    actually, the process should be w3svc.exe or dllhost.exe or w3wp.exe

    to see the username you'd need to add the Username column to the output (richt click the headers and choose "select columns" then add it.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  12. #12
    Join Date
    Apr 2009
    Posts
    31

    Filemon

    John,

    Ok I did as you suggested and looked at the process headers, I filtered all except for w3wp.exe and see the ChangeNotify as the "Other result" and looked at the process and it is the correct user, which in this case it's MSBWEB3 as the machine name and CustomASP as the user. So maybe because it's a machine name and not a domain name that this is causing the problem? The SQL server is a separate machine, but since the Default Application Pool is trying to open the file on the web server, I'd think that this should work, correct?

  13. #13
    Join Date
    Sep 2007
    Posts
    86
    Yes, if MSBWEB3\CustomASP is trying to access the file and has rights to that file and that folder that it is in then you should be okay. Another thing to check is that you are properly closing the file after writing it out. It could be that you haven't closed out the file after the upload and the system doesn't know it's there when you try to access it to perform the batch.

    Just to be clear, the database is not trying to access the file in any way, correct? I presume you are opening the file and generating the batch within code, if not then it may be a different isue.
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  14. #14
    Join Date
    Apr 2009
    Posts
    31
    John,

    I went back and edited that post after realizing that I hadn't removed the user name and pwd to the database. No, the database is on another server within my network. The web server is 10.2.1.66 and as you can see the sql server is 10.2.1.40.

  15. #15
    Join Date
    Apr 2009
    Posts
    31
    So John,

    If I modify this line:

    Dim SaveLocation As String = Server.MapPath("Data") & "\upload.txt"

    to this:

    Dim SaveLocation As String = Server.MapPath("\\MSBWEB3\wwwroot\Webfile1\Data") & "\\MSBWEB3\wwwroot\Webfile1\Data\upload.txt"

    That should work?

Similar Threads

  1. Replies: 0
    Last Post: 10-09-2001, 08:40 AM
  2. Find Dialog - Set the "Look In" path.....
    By Crispin Wright in forum VB Classic
    Replies: 2
    Last Post: 08-26-2001, 06:08 PM
  3. java path
    By feroz in forum Java
    Replies: 1
    Last Post: 05-03-2001, 09:03 AM
  4. ACCESS THE REGISTRY & FIND THE PATH
    By SINNI in forum VB Classic
    Replies: 0
    Last Post: 03-21-2001, 09:00 AM
  5. ACCESS THE REGISTRY & FIND THE PATH
    By SINNI in forum VB Classic
    Replies: 0
    Last Post: 03-21-2001, 09:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center