NAS Head-Scratcher

bhalpinbhalpin Member Posts: 309
The environment is NAV & NAS 5.0 SP1 installed on Server 2003. Server is also running SQL 2005, and NAV db is on that server.

NAS is functioning perfectly, to a point. When NAS boots, code in the DB/company initialises a timer properly, and the correct code fires regularly as desired.

When the NAS timer fires, its job is to read a setup record and get file paths to import from and to log activity to. It then searches the import folder and processes whatever files are there.

I also have a 'test' button on the setup form, that executes exactly the same code as the timer would.

The import folder is set to S:\, which is mapped to \\102.168.100.32\export.

Here is the problem: When NAS runs, this error appears in the event viewer:
The operating system cannot find the drive and directory specified for the file S:\*.* .

But, when I log onto the box as the same Windows user as NAS uses, run the NAV client with (obviously) the same Windows credentials, and click the test button, it finds that path and processes files properly. :-k

I tried setting the import path to \\102.168.100.32\export and the error in the event viewer changed to
Logon failure: unknown user name or bad password.
:-k :-k

Oh, logged onthe the box as the NAS user I can 'DIR' both paths successfully from a command prompt.

I don't think this is a problem with the code that runs (I've got loggin up the ying-yang that tell me EXACTLY the same code runs and searhces the same path.) This has to be some weird Windows credentials error - but I'm not an export in that realm.

Any ideas out there?

Thanks in advance.

Comments

  • ara3nara3n Member Posts: 9,256
    run the timer codeunit from NAV client and see if you are getting any error.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • garakgarak Member Posts: 3,263
    First: Use UNC instead of Drive mapping "S", so you are flexible
    Second: check the permissions of the NAS user in the windows system and the permissions behind the shared folder (\export)
    3-rd: copy a client on the NAS machine and run this client with the NAS user id and start there the codeunit with the timer to see if there comes the error message.

    Regards
    Do you make it right, it works too!
  • bhalpinbhalpin Member Posts: 309
    First: Use UNC instead of Drive mapping "S", so you are flexible

    I did (see original post.) When I used \\102.168.100.32\export I got a different error "Logon failure: unknown user name or bad password.".
    Second: check the permissions of the NAS user in the windows system and the permissions behind the shared folder (\export)

    The NAS service is configured to use the login 'NAS', and I remote desktop to the box using the same login and then run the NAV client as that user. I'm not trying to be difficult, but I don't see how the two login differ with respect to that shared folder. I don't have access to the 100.32 machine to check permissions, but if I do get it, what should I look for?
    3-rd: copy a client on the NAS machine and run this client with the NAS user id and start there the codeunit with the timer to see if there comes the error message.

    As stated earlier, there is a NAV client on the machine, and I do open the db using that client, as the same user as NAS.

    As far as starting the codeunit with the timer, I don't quite see how. The call from the timer codeunit to the 'import' codeunit is in the function NavisionTimer::Timer(Milliseconds : Integer). It contains one line - the call to the import codeunit. I tried creating another codeunit to execute NavisionTimer, but NavisionTimer ss not 'visible' outside the codeunit.

    :-k
  • ara3nara3n Member Posts: 9,256
    does it work when you use local drive?

    make sure you are not missing a back slash.
    c:\export\ instead of c:\export
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bhalpinbhalpin Member Posts: 309
    Work from local drive? Yes, it works when configured to import files from the local drive.

    Missing backslash? My logging displays all the activity including the path being searched:
    Polling Start - 11/05/09  6:12:01 AM
    	User ID: NAS
    	Searching folder S:\
    	No files found
    Polling End -------------------------
    Polling Start - 11/05/09  7:12:01 AM
    	User ID: NAS
    	Searching folder S:\
    	No files found
    Polling End -------------------------
    Polling Start - 11/05/09  8:12:01 AM
    	User ID: NAS
    	Searching folder S:\
    	No files found
    Polling End -------------------------
    
    At this point the NAV client was started, and the 'Manual Import' button was clicked.
    
    Polling Start - 11/05/09  8:54:50 AM
    	User ID: NAS
    	Searching folder S:\
    	Files to process: 1
    	Processing file S:\\THEFILENAME
    	File date: 10/05/09 11:40:20 PM
    	<import details>
    	1 of 1 files processed with 0 errors.
    Polling End -------------------------
    

    I think the extra backslash on the 'Processing file' line is a mistake in the logging code, but it's irrelevant, the file has been found and is imported.

    The main point of the above is that NAS fires the code once an hour, and has been doing that for a month with no hiccoughs. The file manually imported had a date/time of 11:40 PM the previous night, so it had been sitting there for 10 hours or so (and 10 invocations of the NAS import code) without being 'seen'. It was only detected when the NAV client was booted and the import started manually.

    (Still) :-k
  • ara3nara3n Member Posts: 9,256
    That's a different issue. Not able to see is an issue with virtual table file. You need to filter on some other filter and then filter on table to see an update.


    There are many threads on this.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bhalpinbhalpin Member Posts: 309
    Hi Rasheed.

    I think you misunderstood me.

    I have two codeunits:

    #1 - The one containing the timer finction
    #2 - The import codeunit

    If I create a 3rd codeunit and, in it, create a Codeunit variable for #1, the NavisionTimer functions is NOT displayed in the Symbol Menu. So, I can't call the timer function from another codeunit as suggested. So, I can't test this as suggested earlier by calling the timer function.

    Also, I do force a refresh of the virtual file table before 'aiming' it at the import folder.
  • ara3nara3n Member Posts: 9,256
    what is in your CU 1 onRun trigger?

    Aren't you enabling the time components?


    So by just running CU 1 it will start the timer. You can turn on debugger to see the timer event triggering.


    Also it is single instance codeunit?


    I don't understand why you can't run your first CU from object designer.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3nara3n Member Posts: 9,256
    your code looks something like this for refresh?
    LEAR(Files);
    Files.RESET;
    Files.SETFILTER(Path,'C:\');   //to refresh data if the 
    Files.SETFILTER(Path,'%1',GetImportDir);
    Files.SETFILTER(Name,'%1','*.txt');
    Files.SETRANGE("Is a file",TRUE);
    IF Files.FIND('-') THEN
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bhalpinbhalpin Member Posts: 309
    ara3n - Yes, that's almost exactly what my refresh code looks like.

    Bob
  • ara3nara3n Member Posts: 9,256
    can you answer the previous post
    what is in your CU 1 onRun trigger?

    Aren't you enabling the time components?


    So by just running CU 1 it will start the timer. You can turn on debugger to see the timer event triggering.


    Also it is single instance codeunit?


    I don't understand why you can't run your first CU from object designe
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bhalpinbhalpin Member Posts: 309
    Working through suggestion to run CU 1 with debugger on, and I'm seeing interesting stuff. Have to stop now but will continue this investigation - I think it will reveal the answer.
  • bhalpinbhalpin Member Posts: 309
    Rasheed - Sorry, I'm totally jammed up and can't do much today.

    But, I think this all boils down to flakey drive mappings & permissions.

    Bob
Sign In or Register to comment.