can not find channel named "stdout"

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf can not find channel named "stdout"

  • Creator
    Topic
  • #52448
    Kevin Scantlan
    Participant

      On one of our test sites, which is a copy of our production, except changing the protocol on the outbound threads from tcp/ip to file protocol, we are getting errors in the error database that say:  can not find channel named “stdout”.  I get them from different tcl code. One comes from a puts statement and other comes from an echo statement.

      Anyone got any suggestions where to look?  Did a google search and got the following:

      a plain puts raises the error

      cannot find channel named “stdout”

      But as puts is a frequent and useful command, we want to have it working. So here’s a substitute that redirects the output to a specified text widget, if the (implicit or explicit) channel name is stdout or stderr, but else calls the original puts, which was renamed into the ::tcl namespace: }

      proc redef_puts w {

         set ::putsw $w

         if ![llength [info command ::tcl::puts]] {

            rename puts ::tcl::puts

            proc puts args {

               set la [llength $args]

               if {$la<1 || $la>3} {

                  error “usage: puts ?-nonewline? ?channel? string”

               }

               set nl n

               if {[lindex $args 0]==”-nonewline”} {

                  set nl “”

                  set args [lrange $args 1 end]

               }

               if {[llength $args]==1} {

                  set args

        ] ;# (2)

                 }

                 foreach {channel s} $args break

                 #set s [join $s] ;# (1) prevent braces at leading/tailing spaces

                 if {$channel==”stdout” || $channel==”stderr”} {

                    $::putsw insert end $s$nl

                 } else {

                    set cmd ::tcl::puts

                    if {$nl==””} {lappend cmd -nonewline}

                    lappend cmd $channel $s

                    eval $cmd

                 }

              }

           }

        }


      Viewing 7 reply threads
      • Author
        Replies
        • #74231
          David Barr
          Participant

            Can you post your code that is throwing the error? It’s a little bit unclear, but it looks like the code in your post is not the code that is causing the problem but something that you found via Google.

          • #74232
            David Barr
            Participant

              A copy of the “hcidbdump -e -c” output would be helpful as well.

            • #74233
              Kevin Scantlan
              Participant

                Tcl error:

                       msgId   = message0

                       proc    = ‘docNumber_translator’

                       args    = ‘{CONN nusecall_ao_3}’

                       result  = ‘can not find channel named “stdout”‘

                       errorInfo: ‘

                can not find channel named “stdout”

                   while executing

                “puts “======== Doctor Translation Begin ========””

                   (“run” arm line 2)

                   invoked from within

                “switch -exact — $mode {

                       start {

                           # Perform special init functions

                       }

                       run {

                           puts “======== Doctor Translation …”

                   (procedure “docNumber_tran

                *************************************************************************

                Tcl error:

                       msgId   = message0

                       proc    = ‘Keep_Facilities’

                       args    = ‘{UHC CRH}’

                       result  = ‘can not find channel named “stdout”‘

                       errorInfo: ‘

                can not find channel named “stdout”

                   while executing

                “echo “Message CONTINUEd:””

                   (“run” arm line 53)

                   invoked from within

                “switch -exact — $mode {

                       start {

                           # Perform special init functions

                           # N.B.: there may or may not be a MSGID key in args

                      …”

                   (procedure “Keep_Facilities” line 8)

                   invoked from within

                “Kee

                ***************************************************************************

              • #74234
                David Barr
                Participant

                  I’m stumped. Maybe you’re closing stdout in one of your procs. Maybe there’s a failure writing to the process log (permissions, disk full, etc.).

                • #74235
                  Kevin Scantlan
                  Participant

                    It works fine in our production environment.  It’s just in a copy of our production environment where there’s a problem.

                  • #74236
                    Robert Milfajt
                    Participant

                      Same code, works one place, not another, check your version of TCL and extensions loaded in prod and test.  I’ll bet you find your problem there.

                      Robert Milfajt
                      Northwestern Medicine
                      Chicago, IL

                    • #74237
                      Kevin Scantlan
                      Participant

                        Will do that, but that all should be a copy, too.

                      • #74238
                        Kevin Scantlan
                        Participant

                          We WERE closing stdout in a proc, but it was a bit hidden.  We didn’t say “close stdout”, too obvious.  It was in a variable that got set due to certain conditions, that are very rare.  Thanks for all the suggestions.

                      Viewing 7 reply threads
                      • The forum ‘Cloverleaf’ is closed to new topics and replies.