Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43483

Critical messages when using the chat via daemon setup

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.7, 2.5.3, 2.6, 2.7
    • Fix Version/s: 2.9
    • Component/s: Chat
    • Labels:
    • Testing Instructions:
      Hide

      (difficulty: easy, requires system administrator access to the server hosting the Moodle instance)

      1. Check the PHP settings of your Moodle instance to be sure that STRICT errors are reported as well;
      2. Start the chat in daemon mode, without & to look at the logs during the test;
      3. Test the chat activity, using the daemon, as described in http://docs.moodle.org/26/en/Chat_settings#Site_administration_settings. Two separate users with two separate browsers (e.g. CR and FF) will be fine: some chats, some beeps and then close both the chat browser window and wait until you'll read about the disconnection of the two users. Expect a log similar to the one below with no error message like the ones from the issue description:

        # php mod/chat/chatd.php --start
        Moodle chat daemon v1.0 on PHP 5.4.23
         
        [2013-12-22 16:38:18] *IMPORTANT* Started Moodle chatd on port 9111, listening socket Resource id #71
        [2013-12-22 16:38:22] *IMPORTANT* Connection accepted: Resource id #73, SID: jp2S9t1yKYhV6tAYN2RxRsk8RTHtq4Z6 UID: 3 GID: 0
        [2013-12-22 16:38:28] *IMPORTANT* Safari identified...
        [2013-12-22 16:38:28] *IMPORTANT* Connection accepted: Resource id #94, SID: mAG5RnXdifwUw6nrSEcSQn55hymQ7hKL UID: 2 GID: 0
        [2013-12-22 16:40:03] *IMPORTANT* User has disconnected, destroying uid 3 with SID jp2S9t1yKYhV6tAYN2RxRsk8RTHtq4Z6
        [2013-12-22 16:40:03] *IMPORTANT* User has disconnected, destroying uid 2 with SID mAG5RnXdifwUw6nrSEcSQn55hymQ7hKL
        

      Show
      (difficulty: easy, requires system administrator access to the server hosting the Moodle instance) Check the PHP settings of your Moodle instance to be sure that STRICT errors are reported as well; Start the chat in daemon mode , without & to look at the logs during the test; Test the chat activity, using the daemon, as described in http://docs.moodle.org/26/en/Chat_settings#Site_administration_settings . Two separate users with two separate browsers (e.g. CR and FF) will be fine: some chats, some beeps and then close both the chat browser window and wait until you'll read about the disconnection of the two users. Expect a log similar to the one below with no error message like the ones from the issue description: # php mod/chat/chatd.php --start Moodle chat daemon v1.0 on PHP 5.4.23   [2013-12-22 16:38:18] *IMPORTANT* Started Moodle chatd on port 9111, listening socket Resource id #71 [2013-12-22 16:38:22] *IMPORTANT* Connection accepted: Resource id #73, SID: jp2S9t1yKYhV6tAYN2RxRsk8RTHtq4Z6 UID: 3 GID: 0 [2013-12-22 16:38:28] *IMPORTANT* Safari identified... [2013-12-22 16:38:28] *IMPORTANT* Connection accepted: Resource id #94, SID: mAG5RnXdifwUw6nrSEcSQn55hymQ7hKL UID: 2 GID: 0 [2013-12-22 16:40:03] *IMPORTANT* User has disconnected, destroying uid 3 with SID jp2S9t1yKYhV6tAYN2RxRsk8RTHtq4Z6 [2013-12-22 16:40:03] *IMPORTANT* User has disconnected, destroying uid 2 with SID mAG5RnXdifwUw6nrSEcSQn55hymQ7hKL
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-43483_master

      Description

      While working on MDL-43482 I found five minor issues:

      1. First connection of a user:

        ...
        [2013-12-22 14:26:22]  *CRITICAL* [php] Creating default object from empty value on line 251
        ...
        

      2. Beep to a user (sometime):

        ...
        [2013-12-22 14:27:49]  *CRITICAL* [php] Trying to get property of non-object on line 760
        [2013-12-22 14:27:49]  *CRITICAL* [php] Trying to get property of non-object on line 762
        [2013-12-22 14:27:49]  *CRITICAL* [php] Trying to get property of non-object on line 772
        ...
        [2013-12-22 14:40:32]  *CRITICAL* [php] Creating default object from empty value on line 767
        ...
        

      3. When a user closes the chat window, after a while:

        ...
        [2013-12-22 15:47:39] *IMPORTANT* User has disconnected, destroying uid 3 with SID sNCIyyuTVvUzPwnDBJN4hyOkulhm31pK
        [2013-12-22 15:47:39]  *CRITICAL* [php] Undefined index: sNCIyyuTVvUzPwnDBJN4hyOkulhm31pK on line 140
        [2013-12-22 15:47:39]  *CRITICAL* [php] Trying to get property of non-object on line 140
        [2013-12-22 15:47:39]  *CRITICAL* [php] Undefined index: sNCIyyuTVvUzPwnDBJN4hyOkulhm31pK on line 143
        ...
        

      4. When there is only one user in the chat room with no messages yet (sometime):

        [2013-12-26 10:51:41] *CRITICAL* [php] Undefined index: lastinfocommit on line 234
        Default exception handler: Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified. Debug:
        Error code: codingerror
        * line 1166 of /lib/dml/mysqli_native_moodle_database.php: coding_exception thrown
        * line 1222 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
        * line 237 of /mod/chat/chatd.php: call to mysqli_native_moodle_database->update_record()
        * line 470 of /mod/chat/chatd.php: call to ChatDaemon->user_lazy_update()
        * line 605 of /mod/chat/chatd.php: call to ChatDaemon->dispatch_sidekick()
        * line 1098 of /mod/chat/chatd.php: call to ChatDaemon->promote_ufo()
         
        !!! Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified. !!!
        !!
        Error code: codingerror !!
        !! Stack trace: * line 1166 of /lib/dml/mysqli_native_moodle_database.php: coding_exception thrown
        * line 1222 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
        * line 237 of /mod/chat/chatd.php: call to mysqli_native_moodle_database->update_record()
        * line 470 of /mod/chat/chatd.php: call to ChatDaemon->user_lazy_update()
        * line 605 of /mod/chat/chatd.php: call to ChatDaemon->dispatch_sidekick()
        * line 1098 of /mod/chat/chatd.php: call to ChatDaemon->promote_ufo()
        !!
        

      5. In case of strange socket issues - easy to replicate with MDL-43500, when the self-signed certificate has not been yet validated by the browser/user - the output is flooded by socket_select() errors:

        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        [2013-12-27 13:32:51]  *CRITICAL* [php] socket_select(): 150 is not a valid Socket resource on line 742
        

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15