NAS getting stuck when ran as service

rrvanzyl
Member Posts: 21
I am experiencing a rather odd problem with NAS.
I developed a solution to queue reports to be printed as pdf (by BullZip) and then sent through NAS by email as attachments.
Environment is NAV2009 R2 SQL Client, running on SQL2005.
The Email hander code unit is SingleInstance = YES, and has the Navision Timer enabled to trigger every 60 seconds.
When I run the NAS connection through debug, the process executes as expected, ie all pdfs are created and sent via SMPT.
When I run NAS through the command prompt, leaving the dialogue box open, the code is still executed perfecctly.
BUT, as soon as I try and execute the handler from the installed service, it is as if the process gets stuck somewhere, never finishing.
There are no messages in the Event viewer.
For NAS, is have created a new local user name also called NAS and it belongs to the Admin group. I have also logged in physically with this new user name to ensure all windows profile settings are created especially for BullZip. The user is setup in NAV with Super permissions. Changing this to another existing account makes no difference.
The license in the App. Server folder is a developer's license.
Any suggestions or assistance would be appreciated, since I am currently stumped... :-k
I developed a solution to queue reports to be printed as pdf (by BullZip) and then sent through NAS by email as attachments.
Environment is NAV2009 R2 SQL Client, running on SQL2005.
The Email hander code unit is SingleInstance = YES, and has the Navision Timer enabled to trigger every 60 seconds.
When I run the NAS connection through debug, the process executes as expected, ie all pdfs are created and sent via SMPT.
When I run NAS through the command prompt, leaving the dialogue box open, the code is still executed perfecctly.
BUT, as soon as I try and execute the handler from the installed service, it is as if the process gets stuck somewhere, never finishing.
There are no messages in the Event viewer.
For NAS, is have created a new local user name also called NAS and it belongs to the Admin group. I have also logged in physically with this new user name to ensure all windows profile settings are created especially for BullZip. The user is setup in NAV with Super permissions. Changing this to another existing account makes no difference.
The license in the App. Server folder is a developer's license.
Any suggestions or assistance would be appreciated, since I am currently stumped... :-k
0
Comments
-
Very strange...rrvanzyl wrote:There are no messages in the Event viewer.Application Server for Microsoft Dynamics NAV version 6.00 (Build 32012)
Copyright (c) 1987-2010 Microsoft Corporation
Did you have a look at the System folder of the Event Viewer?"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
I do get the NAS version message in the Event Viewer.Application Server for Microsoft Dynamics NAV version 6.00 (Build 32012)
Copyright (c) 1987-2010 Microsoft Corporation
What I meant was, there are no errors...
I am running it now through the command prompt on the server, so far no issues.... but it HAS to word as a service....0 -
That means you also get the message about the NAS login, right?The Application Server for Microsoft Dynamics NAV NameOfYourNAS started with the following configuration:
Database Server Name = xxx
Database = xxx
Company = xxx
Startup Parameter = xxx"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
Yes, the "successful start-up" message.The Application Server for Microsoft Dynamics NAV NAS-SQL started with the following configuration:
Database Server Name = MONSTER-PC
Database = Development
Company = [DEV] Company
Startup Parameter = EMAILBATCH0 -
Ok, that means your issue is located somewhere within NAV. Have you checked if there are records that have to be processed in that company?
Perhaps you could put in some messages to see how far your code is executed."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
Yes, my test dataset has 6 records (customers) to process. For testing purposes I have even tried just doing one.
When I start NAS in debug mode and go through the code, there aren't any issues, the pdf's are created and the mail is sent, the same goes for running NAS from the command prompt.
Just some further info, I am using Expandit MailIt to attach the pdf's and email via SMTP. Works like a charm...normally.
I have been wondering if it couldn't be that there isn't enough "sleep" in the code to wait for the pdf to be created, but then, why would it work when running from the command prompt???0 -
Processing in debug mode is of course somewhat slower than pure NAS. And in command prompt it's also a very little bit slower because the system has to create some output on the screen. But that's only a few milliseconds, so I don't know if that could be an issue. I would give it a try and put some SLEEP commands in."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
I agree. Will give it some sleep and see what happens.
Thanks for your input! Much appreciated!0 -
We have same issues. In all cases where we have the problem is, that Automation is used in the job running under NAS. Each CREATE of the automation is allocating memory and the memory is not correctly released. It is released only by restarting the service. You can minimize this by creating the automation only once in one singleinstance codeunit and use his single instance everywhere. But still in some cases you need to restart the NAS to preven the freezing..0
-
kine wrote:We have same issues. In all cases where we have the problem is, that Automation is used in the job running under NAS. Each CREATE of the automation is allocating memory and the memory is not correctly released. It is released only by restarting the service. You can minimize this by creating the automation only once in one singleinstance codeunit and use his single instance everywhere. But still in some cases you need to restart the NAS to preven the freezing..
You are absolutely correct. I have determined that my problem lies with the ExpadIT MailIT OCX control. When NAS running as a service hits the first MailIT statement, it freezes... Now the question is whether it is a NAV bug, or ExpandIT... #-o0 -
It could be both, but I see the problem with different Automations, it means it is rather NAV problem. But with some it is more often than with other...0
-
I know this topic is quite old, but is there a solution for this problem?
I have the same problem, except that I am using an excel automation and when I call the function "ExportAsFixedFormat", the NAS (Service) is getting stuck. (Everything else matches rrvanzyl's description.)
Kind regards,
Alex0 -
I can't help but wonder if this is an issue of the automation object attempting to create some sort of dialog for the user to interact with. This would run without issue on the client but be a problem under NAS. Of course normally this would result in an error message going into the event log and I know the first poster said there are no messages in the event viewer. Still, for anyone else running into similar issues with automation objects working in the client but not under NAS, I would check to make sure it doesn't attempt to create a dialog at any point.Thad Ryker
I traded my sanity for a railgun0 -
Dakkon wrote:I can't help but wonder if this is an issue of the automation object attempting to create some sort of dialog for the user to interact with. This would run without issue on the client but be a problem under NAS. Of course normally this would result in an error message going into the event log and I know the first poster said there are no messages in the event viewer. Still, for anyone else running into similar issues with automation objects working in the client but not under NAS, I would check to make sure it doesn't attempt to create a dialog at any point.
Kind regards,
Alex0 -
We've got exactly the same issue. It works in NAS if it runs in cmd, but it won't if it runs as service. I assume that you use the same user in cmd that is used as service user?!
We guess that it has something to do with the Windows Profile of the service user. It's probably not fully loaded. At the moment we don't have any explanation why exactly it doesn't work. And it might become even more strange when I tell you that we've had another issue a couple of month ago where we setup something in the user profile of the service user and that works. So, it seems like the user profile is only partially loaded.
Do you know what your automation exactly wants to do? In our case it gets stuck when it tries to read from the registry."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
Hello einsTeIn.NET,
thanks for the answer so far. To answer your questions:einsTeIn.NET wrote:I assume that you use the same user in cmd that is used as service user?!einsTeIn.NET wrote:Do you know what your automation exactly wants to do? In our case it gets stuck when it tries to read from the registry.
BTW, would you mind telling me, what you changed in the profile?einsTeIn.NET wrote:[...] where we setup something in the user profile of the service user and that works. So, it seems like the user profile is only partially loaded.
Kind regards,
Alex0 -
meto89 wrote:einsTeIn.NET wrote:Do you know what your automation exactly wants to do? In our case it gets stuck when it tries to read from the registry.meto89 wrote:BTW, would you mind telling me, what you changed in the profile?einsTeIn.NET wrote:[...] where we setup something in the user profile of the service user and that works. So, it seems like the user profile is only partially loaded.
There is an option to allow services to use some kind of profile (http://msdn.microsoft.com/en-us/library/windows/desktop/ms683502(v=vs.85).aspx) but it's restricted to local system accounts which can't be used for NAV. There's a workaround (http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-desktop-without-localsystem/) but in my case that didn't work either."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
It's finally working for me. The problem for me was that I did not have a "Desktop" folder for the systemprofile. I just needed to create a folder named "Desktop" in this location:
C:\Windows\SysWOW64\config\systemprofile
Keep in mind that the location depends on your setup and you might need to add the folder in this location instead:C:\Windows\System32\config\systemprofile
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions