11 Replies Latest reply on Jul 11, 2010 6:24 PM by 357486

    tpinit failed: TPEOS - operating system error

    tuxit
      Hello,
      I am trying to write a tuxedo monitoring daemon.
      One problem I'm currently facing is that when tuxedo is being stoped example
      tmadmin :
      stop -y -w 5 -c
      the monitoring daemon loses the connection to tuxedo... which is logical to me since tuxedo is stoped.
      but when booting again.
      tmadmin:
      boot -y
      I still can't reconnect. tpinit then get's this error once tux is started again :
      Can't send request to service .TMIB
      Tperrno = 7
      errno: 7
      tpinit failed: TPEOS - operating system error

      the connection code is :
         TPINIT * tpinfo = (TPINIT*)tpalloc((char *)"TPINIT",NULL,TPINITNEED(20));
         strcpy(tpinfo->cltname, "tpsysadm");
         if (tpinit(tpinfo) == -1) 
         {
           printf("errno: %ld\n", tperrno);
           fprintf(stderr, "tpinit failed: %s\n", tpstrerror(tperrno));
           int tret = tpterm();
           if (tret < 0)
           {
               cout << "tprem : " << tret << endl;
               fprintf(stderr, "tpinit failed: %s\n", tpstrerror(tperrno));
           }
           tpfree((char *)tpinfo);
           return -1;   
         }
      when restaring the daemon the connection can be re-established. Is there any way to re-establish without having to restart my daemon process ?

      kind regards,

      Gery

      Edited by: tuxit on 16.06.2010 06:15
        • 1. Re: tpinit failed: TPEOS - operating system error
          Todd Little-Oracle
          Hi Gery,

          Although I'm not certain of this, my guess is that you may need to perform a tpterm() before trying tpinit() again. So when you get the TPEOS error from your tpcall(), my suggestion is you then tpterm() and tpinit() in a loop.

          Regards,
          Todd Little
          Oracle Tuxedo Chief Architect
          • 2. Re: tpinit failed: TPEOS - operating system error
            tuxit
            Hi Todd,
            that's actually what I am doing now. However the tpterm it selves fails as well with the same error. Maybe there is some freeeverything() function somewhere in the API ? I could not find any hints yet.

            the ULOG brings this out put:
            183317.my_server_name!?proc.7381: LIBTUX_CAT:1199: ERROR: Cannot re-attach: operating system error: errno = 22.

            Kind Regards,

            Gery

            Edited by: tuxit on 16.06.2010 09:34
            • 3. Re: tpinit failed: TPEOS - operating system error
              Ed Heeren-Oracle
              Gery,

              The LIBTUX_CAT:1199 message is printed in a function that is normally called only by processes running in protected mode. (In protected mode Tuxedo detaches from the bulletin board shared memory at the end of every call.) My guess is that your TUXCONFIG file specifies "SYSTEM_ACCESS PROTECTED".

              As a workaround, you may want to add the line
              tpinfo->flags = TPSA_FASTPATH;
              in your monitoring daemon to see whether or not that fixes the problem.

              Regards,
              Ed
              1 person found this helpful
              • 4. Re: tpinit failed: TPEOS - operating system error
                tuxit
                Hello Ed,
                Thank you for the input. Infact all my systems have set SYSTEM_ACCESS PROTECTED, NO_OVERRIDE.
                I added the line of code you mentioned before tpinit.
                Even though I could swear that this worked once (re-attached after tux-reboot), I can't reproduce it any more it still failes with the same LIBTUX_CAT:1199 error.
                when starting my daemon with the TPSA_FASTPATH flag set I also get this warning:

                112127.my_server_name!?proc.2833: LIBTUX_CAT:1203: WARN: Cannot override system default access method PROTECTED

                probably because of the NO_OVERRIDE ?

                Regards,

                Gery
                • 5. Re: tpinit failed: TPEOS - operating system error
                  tuxit
                  ...
                  infact removing NO_OVERRIDE in the tuxconfig would do the trick. I tried that on my dev-system. But I doubt that I can do that for all my systems.
                  ...
                  • 6. Re: tpinit failed: TPEOS - operating system error
                    tuxit
                    in order to set TA_SYSTEM_ACCESS to PROTECTED only without NO_ORVERRIDE I try this :
                        FBFR32 *ibuf = (FBFR32 *)tpalloc((char *)FMLTYPE32, NULL, 0);
                    
                        Fchg32(ibuf, TA_OPERATION, 0,(char*) "SET", 0);
                        Fchg32(ibuf, TA_CLASS, 0, (char *)"T_DOMAIN", 0);
                        Fchg32(ibuf, TA_SYSTEM_ACCESS, 0, (char *)"PROTECTED", 0);
                        int retc = tpadmcall(ibuf, &ibuf, 0);
                        if ( retc < 0)
                        {
                            printf("tpadmcall() failed:%s\n",tpstrerror(tperrno));        
                        }
                        tpfree((char *)ibuf);
                    But I get the following error even though I'm tuxadm user and tuxadm group.
                    tpadmcall() failed:TPEMIB - Management Information Base access error

                    Any ideas what could be the suolution ?

                    Cheers,

                    Gery
                    • 7. Re: tpinit failed: TPEOS - operating system error
                      Todd Little-Oracle
                      Hi Gery,

                      How are you performing the tpinit()? I believe you have to set the client to tpsysadm to perform MIB operations.

                      Regards,
                      Todd Little
                      Oracle Tuxedo Chief Architect
                      • 8. Re: tpinit failed: TPEOS - operating system error
                        tuxit
                        Hello Todd,
                        I think tmadmcall should call tpinit with default NULL. But I also tried with the above code to tpinit with
                           TPINIT * tpinfo = (TPINIT*)tpalloc((char *)"TPINIT",NULL,TPINITNEED(20));
                           strcpy(tpinfo->cltname, "tpsysadm");
                        and
                           strcpy(tpinfo->grpname,"tuxadm");
                           strcpy(tpinfo->usrname, "tuxadm");
                        as stated I am tuxadm user and group which is the same as UID and GID in the tuxconfig. But anyway I try I alway get the same error.

                        Reading from T_DOMAIN is working with the same code, only writing failes.

                        Kind Regards,
                        Gery
                        • 9. Re: tpinit failed: TPEOS - operating system error
                          tuxit
                          I found out that I in fact didn't call tpinit.... So I fixed that. tpinit is called successfully now. But the tmadmcall still gives me an error but a different one : tpadmcall() failed:TPEPROTO - protocol error

                          Regards,

                          Gery
                          • 10. Re: tpinit failed: TPEOS - operating system error
                            tuxit
                            So far the only possible soultion I've found is to tmunloadcf the tuxedo configuration, redirect the output to a file change line SYSTEM_ACCESS PROTECTED, NO_OVERRIDE to SYSTEM_ACCESS PROTECTED and then load the file again with tmloadcf tuxcfg.txt <&- in a unix shell.
                            Any way I try with tmadmcall will fail with either TPEPROTO - protocol error or TPEMIB - Management Information Base access error.
                            That also failes when NO_OVERRIDE is not set. It also does not seam to matther whether the tuxedo instance is runing or not. Always the same errors occurs.

                            The code currenlty looks like :
                                TPINIT * tpinfo = (TPINIT*)tpalloc((char *)"TPINIT",NULL,TPINITNEED(20));
                              //strcpy(tpinfo->grpname,"tuxadm");
                              strcpy(tpinfo->usrname, "tuxadm");
                              strcpy(tpinfo->cltname, "tpsysadm");
                              strcpy(tpinfo->passwd,"isitux");
                            
                               tpinfo->flags = TPSA_FASTPATH;
                               long len = 0;
                              
                               if (tpinit(tpinfo) == -1)
                               {
                                 printf("errno: %ld\n", tperrno);
                                 fprintf(stderr, "tpinit failed: %s\n", tpstrerror(tperrno));
                                 int tret = tpterm();
                                 if (tret < 0)
                                 {
                                     cout << "tprem : " << tret << endl;
                                    fprintf(stderr, "tpinit failed: %s\n", tpstrerror(tperrno));
                                 }
                                 tpfree((char *)tpinfo);
                                 //return -1;
                               }
                            
                                FBFR32 *ibuf = (FBFR32 *)tpalloc((char *)FMLTYPE32, NULL, 0);
                            
                                Fchg32(ibuf, TA_OPERATION, 0,(char*) "SET", 0);
                                Fchg32(ibuf, TA_CLASS, 0, (char *)"T_DOMAIN", 0);
                                Fchg32(ibuf, TA_SYSTEM_ACCESS, 0, (char *)"PROTECTED", 0);
                                //int retc = tpcall((char *)".TMIB", (char *)ibuf, 0, (char **)&ibuf, &len, (long)0);
                                int retc = tpadmcall(ibuf, &ibuf, 0);
                                if ( retc < 0)
                                {
                                    printf("tpadmcall() failed:%s\n",tpstrerror(tperrno));        
                                }
                                tpfree((char *)ibuf);
                                tpterm();
                            Cheers,

                            Gery
                            • 11. Re: tpinit failed: TPEOS - operating system error
                              357486
                              Hi,

                              You can have more information about the error when using: tpstrerrordetail(tperrordetail(0),0);
                              I am using for monitor tpcall(".TMIB",...) and it works OK.
                              Flow:
                              Starting application: tpinit(..);
                              Calling TMIB classes in a loop:
                              tpcall (".TMIB",...);
                              if (TPESYSTEM or TPEOS) tpterm;
                              If tuxedo down: tpinit(...) again before calling the service.

                              Hope this help.

                              BR,
                              Revital Bloom
                              revital@midlink.co.il