+ Reply to Thread
Results 1 to 16 of 16

Thread: Product Licensing in Scheduled Batch

  1. #1
    April Nunn
    Join Date
    Apr 2010
    Posts
    16
    Points
    0
    Answers Provided
    0


    0

    Default Product Licensing in Scheduled Batch

    I have an application that selects records from a SQL Server table and geocodes the address, returning the XYs and populating fields in the row. This app was originally written for ArcGIS 9.3, later modified for 10. It was called from either a scheduled task (Server 2008) or xp_cmdshell in SQL Server (2008r2) and worked perfectly.

    But after moving to 10.1 the application no longer works from batch. It runs fine in a command window logged into the server as any user, including the account used for tasks/jobs. It stops when attempting to bind the license with the following error in the Event Log. Any ideas?

    Faulting application name: geocode.exe, version: 0.0.0.0, time stamp: 0x50e6f6bf
    Faulting module name: AfCore_libFNP.dll_unloaded, version: 0.0.0.0, time stamp: 0x4f920360
    Exception code: 0xc0000005
    Fault offset: 0x5963e9b0
    Faulting process id: 0x9230
    Faulting application start time: 0x01cdea912fe817ed
    Faulting application path: C:\tasks\geocode.exe
    Faulting module path: AfCore_libFNP.dll
    Report Id: 6e229a8d-5684-11e2-9618-78e7d1ec71be

    Thanks,
    April

  2. #2
    T. Wayne Whitley

    Join Date
    Apr 2010
    Posts
    1,032
    Points
    848
    Answers Provided
    119


    0

    Default Re: Product Licensing in Scheduled Batch

    It sounds like your compiled app worked with a module referenced that no longer exists or - I like this kind of error message, "...is no longer supported." It seems because you upgraded your exe cannot interact with ArcGIS as before...so my suggestion is if it is any way possible, to 'rewrite' the code in Python (or scripting of your choice) or recompile it after you debug it in VS (provided you have source code).

    Hope that helps...sorry I have only a suggested 'cure' and not the antidote.
    Last edited by Wayne_Whitley; 01-04-2013 at 08:26 AM.

  3. #3
    April Nunn
    Join Date
    Apr 2010
    Posts
    16
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    I've considered rewriting in Python but i'm not sure that will be the fix. The dll referenced in the error does exist, and does not throw an error when run from command prompt. Only in a batch situation does this error occur. What would make the batch Python any different?

    Thanks,
    April

  4. #4
    T. Wayne Whitley

    Join Date
    Apr 2010
    Posts
    1,032
    Points
    848
    Answers Provided
    119


    0

    Default Re: Product Licensing in Scheduled Batch

    hmmmm, see what you mean...I'd be interested to know what this line means, why would this dll be a problem?:

    Faulting module path: AfCore_libFNP.dll

  5. #5
    T. Wayne Whitley

    Join Date
    Apr 2010
    Posts
    1,032
    Points
    848
    Answers Provided
    119


    0

    Default Re: Product Licensing in Scheduled Batch

    ...apparently that's a Flexnet dll? So you have a system problem, is that concerning the license manager?...did you get that far in troubleshooting, see this for example:

    http://systemexplorer.net/file-datab...ore_libfnp-dll

  6. #6
    Johan Fredriksson
    Join Date
    Feb 2013
    Posts
    3
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    Quote Originally Posted by anunn View Post
    I've considered rewriting in Python but i'm not sure that will be the fix. The dll referenced in the error does exist, and does not throw an error when run from command prompt. Only in a batch situation does this error occur. What would make the batch Python any different?

    Thanks,
    April
    Hi April,

    We are having the same problem, but with a windows-service. It runs fine from command-prompt with an exe. But as soon as we put it back in the service we get THE EXACT same message as you.

    Did you solve it? (Pleeease say you did...)

  7. #7
    Richard Watson

    Join Date
    Nov 2009
    Posts
    1,622
    Points
    480
    Answers Provided
    72


    1

    Default Re: Product Licensing in Scheduled Batch

    Running a program in the context of a service is not, in general, the same as running it from the command line.

    One key difference is that services are often run using the System account. That account is special in that it is very powerful on the local machine but it has no network rights, e.g. you cannot access a UNC share.

    Another difference is that services run in Windows session 0 which has many implications. One implication is that there is no UI. Attempts to do things like display a message box will, depending the API, either hang the process or generate an exception.

    There are other, more subtle differences, as well.

    One thing that you can do to help figure this out is to use the SysInternals psexec utility:

    http://technet.microsoft.com/en-us/s...rnals/bb897553

    You will want to check out the "-i 0" and the -s switches. If you Google on these keywords then you will find a lot of useful articles.

    Another trick is to use the Sysinternals Process Explorer utility to look you process. What you want to do is to look at the details of the process properties. It will show all the security information, environment variables, etc. related to the process. For example, perhaps the PATH environment variable is different.

  8. #8
    Johan Fredriksson
    Join Date
    Feb 2013
    Posts
    3
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    Quote Originally Posted by rlwatson View Post
    Running a program in the context of a service is not, in general, the same as running it from the command line.

    One key difference is that services are often run using the System account. That account is special in that it is very powerful on the local machine but it has no network rights, e.g. you cannot access a UNC share.
    Our service in running under user-account with the correct privs. It is the same user we test with command-exe.

    EDIT: Nooooo. Apparently it was not the correct privs as when i changed to my admin-account. It worked! Our service-account had been downgraded on the test-machine OR 10.1 demands more of the account running the service and binding the license, then earlier versions. THANKYOU!
    Last edited by dotunited; 02-24-2013 at 03:21 PM. Reason: Found answer

  9. #9
    April Nunn
    Join Date
    Apr 2010
    Posts
    16
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    Quote Originally Posted by dotunited View Post
    Hi April,

    We are having the same problem, but with a windows-service. It runs fine from command-prompt with an exe. But as soon as we put it back in the service we get THE EXACT same message as you.

    Did you solve it? (Pleeease say you did...)
    Yes I did, after determining the problem was permissions on the service account (as related in the other post). But another issue I ran into was our security team - service accounts aren't allowed the necessary privileges here, and I am required to use a security account for scheduled jobs. So I re-wrote my app to use locator and map services instead of accessing the database directly. It might be a smidge slower but speed really isn't an issue in our use.

    Glad you got it fixed,

    April

  10. #10
    Johan Fredriksson
    Join Date
    Feb 2013
    Posts
    3
    Points
    0
    Answers Provided
    0


    0

    Smile Re: Product Licensing in Scheduled Batch

    Quote Originally Posted by anunn View Post
    Yes I did, after determining the problem was permissions on the service account (as related in the other post). But another issue I ran into was our security team - service accounts aren't allowed the necessary privileges here, and I am required to use a security account for scheduled jobs. So I re-wrote my app to use locator and map services instead of accessing the database directly. It might be a smidge slower but speed really isn't an issue in our use.

    Glad you got it fixed,

    April
    Hi April,

    Would you know the exact privileges the account need?

    Thanks
    Johan

  11. #11
    April Nunn
    Join Date
    Apr 2010
    Posts
    16
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    Not exactly, but something to do with logon. I was told very little by the security team. Maybe there are more details in the link on the other post???

    Sorry,

    April

  12. #12

    Join Date
    Apr 2013
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    Quote Originally Posted by anunn View Post
    Not exactly, but something to do with logon. I was told very little by the security team. Maybe there are more details in the link on the other post???

    Sorry,

    April
    Hello,

    I have the same problem. Does anyone know the permissions required to run Python from a scheduled task?

    Thanks,
    Ana

  13. #13
    Julie Kub
    Join Date
    Jul 2011
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    The Esri development team gave me a fix.

    The issue here is that the FLEXnet Licensing Service (which Esri now uses at 10.1, but was not used in 10.0) doesn’t have the proper execution permissions set to it such that the “Network Service” account can start it.

    Esri working on a patch, but in the meantime, there is a manual workaround:

    1. Ensure that you are logged in as a user with administration privileges on the machine.

    2. From the windows Start menu, select run and enter ‘cmd’. Right-click on “cmd.exe” and select “Run as Administrator.”

    3. In the command prompt, run the following command:
    sc sdshow "FLEXnet Licensing Service"

    This will print out the DACL permissions that are registered with that service:
    DD;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;NU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCLCSWRPLOCRRC;;;IU)SAU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)

    We need to insert “(A;;CCLCSWRPWPDTLOCRRC;;;WD)” into the permission string, such that it becomes:
    DD;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;NU)(A;;CCLCSWRPWPDTLOCRRC;;;WD)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCLCSWRPLOCRRC;;;IU)SAU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
    NOTE: The user’s DACL string may vary, and edits to the string should be done carefully.

    4. To register the DACL with the service run the command:
    sc sdset "FLEXnet Licensing Service" ${your original DACL string with the new permission string inserted}

    For the example above you would enter:
    sc sdset "FLEXnet Licensing Service" DD;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;NU)(A;;CCLCSWRPWPDTLOCRRC;;;WD)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCLCSWRPLOCRRC;;;IU)SAU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)

    5. You should see a [SC] SetServiceObjectSecurity SUCCESS. That's it. Network Service should now run without error.

  14. #14
    Julie Kub
    Join Date
    Jul 2011
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    I don't know why my last post added strange unhappy face characters.

    Please look at my other post at:
    http://stackoverflow.com/questions/1...indows-service

    This is the same information without the unhappy face symbols.

  15. #15
    Ken Buja

    Join Date
    Jan 2010
    Posts
    1,219
    Points
    882
    Answers Provided
    152


    0

    Default Re: Product Licensing in Scheduled Batch

    You can avoid those symbols by putting the text in one of the wrappers such as CODE or QUOTE. The text interpreter transforms groups of characters such as : followed by ( as
    Ken Buja
    Silver Spring, MD

  16. #16
    emeline renz
    Join Date
    Sep 2012
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Re: Product Licensing in Scheduled Batch

    Just to chime in here...

    I was running a BAT script from Task Scheduler that called a python script. I could run it from Windows Explorer or the command line, but it was failing with the same error when running from Task Scheduler, "Faulting module name: AfCore_libFNP.dll_unloaded".

    In the BAT file, I was referencing:
    <Drive>:\Python27\ArcGIS10.1\python.exe

    When I changed the path to:
    <Drive>:\Python27\ArcGISx6410.1\python.exe

    the Task ran successfully.

    If you are running the app on a 64-bit server, try using the x64 directory path to python.exe instead. Worked for me.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts