Job Queue error: The operating system cannot find the drive

dulamandulaman Member Posts: 73
Hi,

I am facing a strange issue with NAS and Job Queue.

I needed to create a file each morning so I created a Codeunit that makes the hard work. In a given moment, the codeunit is calling a report that will actually create the file xxx.txt in a folder C:\TEMP\

Everything goes well and running smooth when I run the codeunit manually: Alt+R from the Object Designer.

But when I put that same codeunit in the Job Queue, I get this error:
The operating system cannot find the drive and directory specified for the file C:\TEMP\xxx.txt .
Please check that the drive, directory and file names are correct.

I am very puzzled. What I am doing wrong?? ](*,)
-- dulaman
"I don't want to believe. I want to know." (Carl Sagan)

Answers

  • krikikriki Member, Moderator Posts: 9,118
    The codeunit is run on the computer that runs the jobqueue. Has that computer subdirectory c:\temp?

    BTW: You would better use : ENVIRON('temp') to know which is the temp directory on any computer.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • jlandeenjlandeen Member Posts: 524
    You may also want to check the security context which the Job Queue is running under. There should be user assigned as the login user for the NAS which is running the Job Queue. That user will have to have permissions to read and write to the C:\TEMP on the machine in addition to the folder existing.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • nthainthai Member Posts: 22
    I've experienced something weird like that in the past. I didn't know how to fix it but I figured out how to get around it.

    I get around that by putting a dummy file in the subdirectory. For example:

    X:\Temp\dummy.txt [X:\ is a Network Drive]

    Then before I write to the Temp folder, I would first check if the file dummy.txt in that directory exist, if it is then it is a good Path, then I write my output file to that directory.

    Files."Is a file"
    or
    FILE.EXISTS(FileName)

    I don't know if you have the same scenario, but I hope this will help.

    NIEM THAI
  • jlandeenjlandeen Member Posts: 524
    There is also a "Folders" virtual table (I think that's the table name)....it's one of the high range virtual tables that are part of base NAV. That should also give you a mechanism to check if a folder is there.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • dulamandulaman Member Posts: 73
    Hello everybody,

    Thank you VERY MUCH for your answers, they were really useful and helped me to solve the issue as they forced me to review everything from scratch.

    I was pointing to a wrong computer in the network! :oops: In that computer the folder C:\TEMP didn't existed... :oops:

    As far as I created the folder in the right computer, everything went well. \:D/

    Thank you again for your help, guys!!
    -- dulaman
    "I don't want to believe. I want to know." (Carl Sagan)
  • krikikriki Member, Moderator Posts: 9,118
    You'd better use ENVIRON('temp') instead of hardcoding "c:\temp".
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dulamandulaman Member Posts: 73
    Thanks Kriki for the tip, but in this case C:\TEMP\ was only an example, I was not actually using that folder. :wink:
    -- dulaman
    "I don't want to believe. I want to know." (Carl Sagan)
Sign In or Register to comment.