Options

Job Queue runs successfully but the data is not imported

divyaseekuntadivyaseekunta Member Posts: 24
edited 2014-07-29 in NAV Three Tier
I have a job scheduled in Navision to be run every 30 mins. This job runs to pick up data from a specified location (Rec folder) and import the data into Navision. After the import of data, the same job archives the file from Rec Folder to another Archive folder.

This job was running fine till some weeks ago.

Now the same job runs, the status is successful in Job Queue Log Entries but no data is imported and the file is still in the Rec Folder.

Can anyone help me on that?

Note:
- I have already tried stopping the active jobs and restarting NAS
- I have also tried to create a new job but this also does not work
- Navision version used is (Version FR 4.00 SP 2) (6.00)

Kind Regards
Divya

Comments

  • Options
    vremeni4vremeni4 Member Posts: 323
    Hi,

    It could be a few things,
    - security, NAS user does not have access on that folder, anymore.
    - extensions of the file changed, for example, Navison code is looking for files with extension .csv but the file has .XML or .txt
    - set up in NAV was changed, NAV is looking in the folder C:\upload, but files are deposited in folder F:\Upload

    The best way to debug this is to login on a PC with the user name and password that is used by NAS.
    Then Start Navision and run the report or codeunit that is supposed to import the files.
    You will see all error messages that may prevent the import.

    I hope this helps.
    Thanks.

    I hope this helps.
    Thanks.
  • Options
    KishormKishorm Member Posts: 921
    I assume the job would not error if there were no files to import, assuming this is the case then it could be that your job is looking for files in the wrong folder or maybe the files are not named correctly so that your job doesn't actually see any files to be imported. In this scenario you would get the results you are seeing, i.e. Job queue processing successful (as it found no files so no error), no data imported and files left where they are.

    Regards
    Kishor
  • Options
    divyaseekuntadivyaseekunta Member Posts: 24
    Dear all,

    Thank you for the feedback. I will try to verify the access on the directories and update you on the outcome.

    Thanks & Regards,
    Divya
  • Options
    divyaseekuntadivyaseekunta Member Posts: 24
    Dear All,

    Following your posts, I have tried the following steps:
    1. Verified the permissions of the user: the user has sysadmin rights
    2. Verified if the user has access to the path of the folders specified:the user has all the required accesses.
    3. Verified if the file paths are correctly defined.

    However, the jobs are still running and no files are being picked up.
    Could you please advise on any other next steps?
    Thanking you in advance,

    Best Regards,
    Divya
  • Options
    urpokurpok Member Posts: 23
    Could you please advise on any other next steps?
    Thanking you in advance,

    Best Regards,
    Divya

    Last time I run into this "problem" was that the file name was written first in capitalized letters, and then for some reason the software that delivered the file to be read had changed the extension to non-capitalized letters.
    I had to alter my functions to filter BOTH ".txt" and ".TXT".

    And boy, did I feel stupid when I noticed this after two hours of ](*,)

    regards, urpok
    "There is no spoon."
    --Matrix

    https://navurpo.blogspot.com/?view=classic
  • Options
    thegunzothegunzo Member Posts: 274
    Hi

    I have moved away from the FILE virtual table to dotnet objects. The objects that I use are part of mscorlib and are also used in codeunit 419.

    Here is an example.
      Files := DirectoryHelper.GetFiles("Import POS Sale Directory");
      IF Files.Length > 0 THEN BEGIN
        ImportLog."No. of Files" := Files.Length;
        DialogMgt.WindowOpen('#1##########################\\@2@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
        DialogMgt.WindowSetTotal(2,Files.Length);
        FOR Index := 1 TO (Files.Length) DO BEGIN
          FileName := Files.GetValue(Index - 1);
          DialogMgt.WindowUpdateText(1,STRSUBSTNO(Text001,PathHelper.GetFileName(FileName)));
          DialogMgt.WindowProcess(2);
          SalesDate := ImportFile(FileName);
          CreateDirectory("Posted POS Sales Directory");
          CreateDirectory(PathHelper.Combine("Posted POS Sales Directory",FORMAT(SalesDate,0,'<Year4>')));
          CreateDirectory(PathHelper.Combine("Posted POS Sales Directory",FORMAT(SalesDate,0,'<Year4>\<Month,2>')));
          CreateDirectory(PathHelper.Combine("Posted POS Sales Directory",FORMAT(SalesDate,0,'<Year4>\<Month,2>\<Day,2>')));
          FileHelper.Copy(
            FileName,
            PathHelper.Combine(
              PathHelper.Combine(
                "Posted POS Sales Directory",
                FORMAT(SalesDate,0,'<Year4>\<Month,2>\<Day,2>')),
              PathHelper.GetFileName(FileName)));
          FileHelper.Delete(FileName);
          PostingCounter := PostingCounter + 1;
        END;
        DialogMgt.WindowClose;
      END;
    
    
    LOCAL CreateDirectory(DirectoryPath : Text)
    IF NOT DirectoryHelper.Exists(DirectoryPath) THEN
      DirectoryHelper.CreateDirectory(DirectoryPath);
    
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • Options
    thegunzothegunzo Member Posts: 274
    And, I also use dotnet to read the file

    http://www.dynamics.is/?p=1405
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • Options
    divyaseekuntadivyaseekunta Member Posts: 24
    Dear All,

    Thank you for your replies. Unfortunately these solutions do not suit our needs.

    However I have tried the following:
    1. I have placed the files in the defined path.
    2. I have run Job Queue Dispatcher.
    3. The files were successfully imported in Navision but then all other jobs stopped working and when I placed again another file, they were not imported.
    4. I had to restart NAS so as other jobs can continue but then the issue remains the same.

    My question is why on running the Job Queue Dispatcher, the files were imported that also only once?

    Thanking you for your precious help,

    Best Regards,
    Divya
  • Options
    einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    What do you mean by "all other jobs"? Do you have more than one Job Queue Entry and these are not executed any longer after your file import job ran once?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Options
    divyaseekuntadivyaseekunta Member Posts: 24
    Hello,

    Yes we have several jobs running, hence for each job we have a job queue entry.

    What we are now trying to do is to use the NAS debugger in order to locate the issue.

    I will keep you updated about the results.

    Thanks & Regards,
    Divya
  • Options
    einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    If all the other Jobs do not run any longer after the File Import Job started, it could only be something that stops the whole NAS. That means either the NAS process crashes (you would see some kind of error message in the Windows Event Log) or NAS is in some kind of endless loop (e.g. it waits for an external component to give some feedback).

    We had this kind of issue when we tried to execute an external process. When this process was executed directly by an user then there was no GUI available. That's why we thought we could use it for NAS as well. But since Windows (I think this starts with Windows Server 2008) tries to create some kind of User Profile in background to "interact with the desktop", and it's not possible to create that profile for the NAS user, NAS waits until forever. Please have a look at this topic (http://www.mibuso.com/forum/viewtopic.php?f=23&t=49235). Maybe it helps.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Options
    divyaseekuntadivyaseekunta Member Posts: 24
    Dear,

    Thank you for the reply I will check on it.

    For info, I have tried to run NAS in debug mode but has been unable to do so. The steps are as follow:
    1. Create Breakpoints in Navision in the job concerned
    2. Create a file named 'Breakpoints.xml' and save it in Location XXX where the NAS server lies.
    3. Stop NAS service
    4. Create a bat file with the following parameters:
    "C:\Program Files (x86)\Microsoft Dynamics NAV\60\Application Server\nassql.exe" Debug,Breakpoints=C:\Breakpoints.xml,appservername="NAS server name”,servername="Navision Database server”,DATABASE="Navision Database",company="Navision Company”,startupparameter=tcp

    However, on clicking on the .bat file, nothing happens. Can anyone help on how to specify the parameters on how to debug NAS?

    Thanking you in advance,

    Best Regards,
    Divya
  • Options
    einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    There's no need to store the breakpoints.xml in the NAS installation folder. By default the user files folder of the NAS user will be used. So, if you store it there it would also work. And, this is nothing you create yourself. Your normal NAV Client will do it for you after you set your breakpoints and close the client. It will be stored in your user files folder.

    I doubt that Startupparameter is tcp. If you haven't changed it, it's JOBQUEUE (or OSYNCH because the Outlook Integration uses the same functionality).
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Options
    dipo_oyekanmi2014dipo_oyekanmi2014 Member Posts: 1
    Hello

    This looks like a similar challenge we are having in my organization. We have a job queue that posts entries into customers accounts but the job queue stops intermittently at frequent intervals due to other processes running on the database. I would like to know if it's possible to make the job queue run without being locked by other processes or if it is possible for the job queue to restart itself automatically in case it encounters an error.
  • Options
    einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    In case of a normal lock, Job Queue will wait until the lock is released again and then resume its task. That means this shouldn't be any issue unless some user executes some long-term running task. Then maybe you could talk to the user to run that task at another point in time.
    In case of dead lock, you should try to figure out where it is coming from and perhaps reorganize either your code or your schedule of Job Queue.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Options
    divyaseekuntadivyaseekunta Member Posts: 24
    Hello Bochum,

    Thank you for the reply. We have been able to run the NAS in debug mode. :)

    However, in the command prompt, the following errors are being displayed:
    1. The network path is not valid.
    2. The time is not valid.

    Do you have any idea on the possible causes please?

    Thanking you in advance,

    Best Regards,
    Divya
  • Options
    einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    However, in the command prompt, the following errors are being displayed:
    The same errors should be displayed in Windows Event Log when you execute NAS as a service.
    1. The network path is not valid.
    I assume you try to use a network path that is not available from the machine where you run the NAS. That could be caused by several reasons, e.g. the network location is in another part of your network, or the network path is misspelled, or the NAS user has not enough rights to use that network path, ...
    2. The time is not valid.
    I assume that you try to import a time field from your data files and in that file the time is not formatted in the correct way. That means that time information is eihter formatted in a way that NAV can't understand directly, or the languages settings of the machine where your NAS runs are different to the languages settings of the machine where the file is created. That means e.g. in your country the standard format for time might be hh:mm:ss (on 24 hours base), but in the file the time is formated like 1:23:45 pm.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Options
    divyaseekuntadivyaseekunta Member Posts: 24
    Dear All,

    After debugging in the NAS server, we found that the path of the NAS server and file location of the database server were different. That is why running the jobs on NAS server, the files were not being picked up.
    This issue has now been resolved.

    Thank you all for your support and help.

    Best Regards,
    Divya
  • Options
    einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Although I don't understand your explanation (because, of course, the path of the NAS Server could be different to the one of the database server), I'm glad that it's solved.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.