13 Replies Latest reply on Nov 16, 2021 9:55 AM by Santosh Gade

    Can UNC path be a parameter in workflow command task

    Michele DuBose Seasoned Veteran

      Hello, I've created a workflow that contains a command task.  In the command task, it's calling a batch file on the Informatica server and passing two parameters. One parameter is a UNC path. While running the batch file on the Informatica server, and hard coding the parameter values, it runs successfully. However, while running the workflow, the command task displays as successful in Workflow Monitor, however, while reviewing the workflow log, the command tasks throws an error: "Command task instance [name of task]: execution of command [name of command] did not complete successfully with exit code [1]". Can a UNC path be a parameter in workflow command task?  Is there a way to debug the command task to troubleshoot the error?

        • 1. Re: Can UNC path be a parameter in workflow command task
          pgeorge1 Guru

          Please send the actual parameter value you are attempting.

           

          You can look in the Integration Service log for an error.

          If there is no error in the IS log you can look in the Domain log or perhaps the Windows Event Viewer under the same time stamp.  I think you would look under the Application log of the Event Viewer.

          • 2. Re: Can UNC path be a parameter in workflow command task
            Pavani Mylaram Active Member

            Share the actual parameter value and the command used in the command task. Also, please check if you are able to run the batch from the Windows run application.

            • 3. Re: Can UNC path be a parameter in workflow command task
              Nico Heinze Guru

              In general, it is no problem to hand over a UNC path in some workflow variable. I'm doing that in a workflow to check whether access to some file share works from the PowerCenter server.

               

              The workflow log should list the command to be executed immediately before it's executed.

              Can you please share the relevant portion of the workflow log?

               

              Regards,

              Nico

              • 4. Re: Can UNC path be a parameter in workflow command task
                Michele DuBose Seasoned Veteran

                The command that's included in the workflow command task is similar to this: $PMRootDir\BatchScripts\Folder1\SubFolder \\myServer\myFolder\mySubFolder searchAndcreatefile

                 

                In the Admin Console, I've checked the Domain logs and found that the process throws an access denied error.  A screenshot of the error is attached.

                 

                It seems whatever account is running the Informatica Integration service does not have access to \\myServer\myFolder\mySubFolder.  I've granted the windows service account that's running Informatica, access to \\myServer\myFolder\mySubFolder, however, I'm still getting the access denied error. When I run the batch file manually, it's running under my windows account which has access to \\myServer\myFolder\mySubFolder. How can I find which account is running Informatica?

                 

                 

                EDIT:

                I've granted the windows service account full control to the \\myServer\myFolder\mySubFolder directory.  I've also granted the service account full control to $PMRootDir\BatchScripts\Folder1\SubFolder.  I'm still getting an Access Denied error.  I've checked the service log and do not see any errors.  The only error I see displays under Domain logs.  Below is the batch script called from the workflow command task:

                 

                pushd %1

                popd

                 

                set timestamp=%date%_%time%

                set timestamp=%timestamp: =_%

                set timestamp=%timestamp::=%

                set timestamp=%timestamp:/=%

                set timestamp=%timestamp:.=_%

                set timestamp=%timestamp:~5%

                 

                if exist %1\%2.txt" rename %1\%2.txt %2%timestamp%.txt

                if exist %1\%2%timestamp%.txt move %1\%2%timestamp%.txt %1\Archive

                 

                pushd "%1" && (forfiles /M cdr_* /C "cmd /c echo @fname >> %2.txt") & popd

                 

                As mentioned, the script executes successfully when ran manually which tells me that the account running the script, can connect to the UNC path. I do not understand when the script is ran from the Integration service, it errors.

                • 5. Re: Can UNC path be a parameter in workflow command task
                  Nico Heinze Guru

                  As this is a Windows installation, it runs as a Windows service.

                  So you simply (yes, I know, permissions...) have to open the Services panel on the Windows server, look for the Informatica service, and check its properties to see the user ID.

                  I don't know of any other way to get to know the user ID running this Windows service.

                   

                  Regards,

                  Nico

                  • 6. Re: Can UNC path be a parameter in workflow command task
                    Michele DuBose Seasoned Veteran

                    The windows service has been granted full control to the UNC directory.  The access denied error still exists.

                    • 7. Re: Can UNC path be a parameter in workflow command task
                      Nico Heinze Guru

                      In order to debug this issue, may I suggest you create a new command task. In this command task, do a "dir ... >$PMTargetFileDir\dirshare.out 2>$PMTargetFileDir\dirshare.err" (replace the three dots with the root directory or the share).

                      Now run this command task and see what the files dirshare.out and dirshare.err in the $PMTargetFileDir directory contain. If a "dir" in the root directory of the share doesn't work, then it's definitely a permission problem. Otherwise you should get some clean "dir" output in dirshare.out and nothing in dirshare.err .

                       

                      If it is a permission problem, please check whether the service user running the Windwos service Informatica... has inherited permissions from some group or whether access permissions to that share have been granted to this user ID directly. There have been cases in the past (I know of three cases in the past 8 years) when the service user could not inherit the correct permissions from its group assignments, but if permissions were given to tthat user ID directly it worked.
                      A small and rare glitch in Microsoft Active Directory.

                       

                      Regards,

                      Nico

                      • 8. Re: Can UNC path be a parameter in workflow command task
                        Michele DuBose Seasoned Veteran

                        I created a new command task as dir //myserver/folder/subfolder >$PMTargetFileDir\dirshare.out 2>$PMTargetFileDir\dirshare.err.  The dirshare.out was empty. The dishare.err contained "Access Denied". The service account was granted access directory to the share directory but still the issue continued.  I restarted the service account and that fixed the issue.  I don't know how that fixed permission issues to the share but it appears it has.

                        • 9. Re: Can UNC path be a parameter in workflow command task
                          Nico Heinze Guru

                          The whimsical world of modern IT...

                           

                          It may be that during the restart of the Windows service the permissions stored in the Active Directory were read and updated for that user ID, so whatever wrong information was cached for this user ID it's now correct.

                          Just a weak guess.

                           

                          Glad to hear that you were finally able to get it resolved.

                           

                          Regards,

                          Nico

                          • 10. Re: Can UNC path be a parameter in workflow command task
                            Santosh Gade Guru

                            I dont think PMRoot can be substituted as an environment variable so using it in command tasks might not be possible .

                             

                            These are just to be taken as variables within the Integration Service .

                            • 11. Re: Can UNC path be a parameter in workflow command task
                              Nico Heinze Guru

                              With all due respect, but the question was NOT about taking an environment variable for $PMRootDir (that's not possible, this is correct). The question was about using a UNC path for $PMRootDir which works well under Windows.

                               

                              Regards,

                              Nico

                              • 12. Re: Can UNC path be a parameter in workflow command task
                                Michele DuBose Seasoned Veteran

                                Thank you all for your feedback.  This issue is resolved. Restarting the Informatica windows service fixed the permission issue to the UNC path.

                                • 13. Re: Can UNC path be a parameter in workflow command task
                                  Santosh Gade Guru

                                  ooh .. Got it ... The UNC path may need to be mounted with a psudo root access with utilities like psexec sometimes to get rid of this issue. Probably OS Admin can help remounting it with psexec