ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

    I'm running a shell script created on the Q-shell platform. The script I created runs fine when run from the qsh command line. It also runs fine when called from the 400 command prompt by issueing qsh cmd('......') However, if I try to schedule the job using wrkjobscde and in there use the qsh cmd('....') calling method, the job does get kicked off as it should on the given scheduled date/time, but it immediately fails with: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVAILABLE TO COMPLETE REQUEST.

    I have put in debug "echo" statements in the shell script to see at what point this fails and from what I can see, it fails when I try to call out to the system to do a task and pass it back to a variable in the shell script. An example of the code that fails is-> export thisHost=$(hostname | sed 's/\..*//')

    What I don't understand is how this can run fine from the command line in qsh or as called from a qsh cmd call, but just going through the job scheduler causes this different behavior. Anyone have any ideas?

  • #2
    Re: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

    I'm not well versed in qsh, but ....

    Usually when a job works from command line, but not from the scheduler, its one of 3 things

    1. The library list is different (whose profile is the submit under?)
    2. Authority issues (whose profile is the submit under?)
    3. Attempting to run a job that requires interactive

    I would suggest checking the user profile of the job when submitted and see if it matches when launched from command line.

    Comment


    • #3
      Re: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

      matt,

      i recently took an interest in qshell as well..and here's what i noticed...qshell interpreter in iseries is a process and every command inside qshell interpreter runs in its own job (QP0ZSPWP)..when an interactive qshell session is started the OS/400 starts the batch job for qsh interpreter also something that looks in wrkusrjob as '..QZSHSH' everytime i execute an interactive qshell command..i find these two jobs placed in my default outQ... if interactive these jobs are almost always started by OS/400 immediately..it is also possible to prestart these jobs when the subsystem is started so when u have a qshell script in a job scheduler the process doesnt have to look if the jobs are started already or not...

      my guess would be when it is trying to execute ur qshell script it is isnt finding one of the jobs QZSHSH , QP0ZSPWP started ...or both...you can check this using a WRKUSRJOB or WRKACTJOB to see if they are up...

      being new to qshell i am starting to write some scripts myself and am thinking of using the prestart job entry to avoid confusion or to make the system look for a job to see if its started or not... it goes something like this...

      ADDPJE SBSD(QSYS/sbsname) PGM(QSYS/QP0ZSPWP) .....
      (please research this command for full parms info)

      goodluck

      Comment


      • #4
        Re: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

        hey i also noticed that your error message said " 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA "

        which would mean the child processes are not using the job that is started already...

        try this..

        place a 'Y' in the environment variable QSH_USE_PRESTART_JOBS
        and

        export -s QSH_USE_PRESTART_JOBS=Y

        to make the child processes use the prestart jobs

        Comment


        • #5
          Re: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

          Originally posted by arrow483 View Post
          I'm not well versed in qsh, but ....

          Usually when a job works from command line, but not from the scheduler, its one of 3 things

          1. The library list is different (whose profile is the submit under?)
          2. Authority issues (whose profile is the submit under?)
          3. Attempting to run a job that requires interactive

          I would suggest checking the user profile of the job when submitted and see if it matches when launched from command line.
          The job that would be running from the job scheduler is running from the same profile (user) as when it is directly called from the command line. Also the job isn't interactive so that shouldn't be an issue. Please note that even when run from the scheduler, the qshell script does in fact get executed and is going along on its merry way until it hits a specfic line in the code. This same line of code runs just fine from the command line call. For some reason in the scheduled call it reports, "Error Message: 001-0012 Error found starting child process. SYSTEM RESOURES NOT AVAILABLE TO COMPLETE REQUEST" The line it fails on is something like SOMEVAR=$(hostname | sed 's/\..*//') which should basically inquire with the system what is the host name value, send it to a sed command (single line editor) strip off any '.' character followed by any number of other characters and return the result into SOMEVAR.

          Comment


          • #6
            Re: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

            Originally posted by SG_FTL View Post
            hey i also noticed that your error message said " 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA "

            which would mean the child processes are not using the job that is started already...

            try this..

            place a 'Y' in the environment variable QSH_USE_PRESTART_JOBS
            and

            export -s QSH_USE_PRESTART_JOBS=Y

            to make the child processes use the prestart jobs
            I put the export -s QSH_USE_PRESTART_JOBS=Y into the .profile of the user (/home/user/.profile) that would be running scripts, also I put this line as the first line of the script I was trying to run so that if it was called and this hadn't been set, it would set it first thing. This didn't change the outcome. Please note that even when run from the scheduler, the qshell script does in fact get executed and is going along on its merry way until it hits a specfic line in the code. This same line of code runs just fine from the command line call. For some reason in the scheduled call it reports, "Error Message: 001-0012 Error found starting child process. SYSTEM RESOURES NOT AVAILABLE TO COMPLETE REQUEST" The line it fails on is something like SOMEVAR=$(hostname | sed 's/\..*//') which should basically inquire with the system what is the host name value, send it to a sed command (single line editor) strip off any '.' character followed by any number of other characters and return the result into SOMEVAR. If I were to comment out this line, the script would get further until it hit another similar line of code where I call an op system shell command and try to return the value back into a variable. If I took all these out, I suppose it would run but then, I need these to set some things that other processing is depending on. It is almost like what it is saying from the scheduler is that, "I'll let you call a qsh script and I'll run it (in fact I'll let that script call other scripts and run them) but when you get too deep for me to handle, I'm not going to let you do it."

            Comment


            • #7
              Re: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

              OH, and one more thing I forgot to mention. This is deployed on 3 different 400 servers and only the one server is having this trouble calling the process from wrkjobscde.

              Comment


              • #8
                Re: Error Message : 001-0012 Error found starting child process. SYSTEM RESOURCES NOT AVA

                HOLY #$!& I found it! Basically when I quoted below that I thought it was like it was getting so deep then erroring out. I started thinking there must be a limit set on the system that is keeping me from calling too many layers of function calls/scripts/programs. So, I found a command CHGSBSD which allowed me to reset the max jobs on the subsystem this was running on and what do you know, it is working now.

                Comment

                Working...
                X