Announcement

Collapse
No announcement yet.

Error when uploading an attachement

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

  • [Bug / Issue] Error when uploading an attachement

    1. vBulletin Version - Viewable in the header of the AdminCP. 5.6.1 patch 1
    2. PHP Version - Viewable on the AdminCP Home Page. 7.3.9-1~deb10u1
    3. MySQL Version - Viewable on the AdminCP Home Page. 10.3.17-MariaDB-0+deb10u1
    4. Any Addons installed. Redirect Topic Title to First New or Last Post by vBMods.rocks
    5. Does the issue occur in a default style? yes
    6. Does the issue occur using the English language provided? yes
    7. Error message on the screen.
      WIN_20190108_23_01_39_Pro.jpg
      Error Invalid SQL: SELECT IF(filehash = MD5(filedata), 1, 0) AS filehash_matches, IF(filesize = LENGTH(filedata), 1, 0) AS filesize_matches FROM filedata AS fd WHERE filedataid = 36183 /**checkFiledataConsistency**/;
      Exception trace:
      ## /var/www/clients/client1/web1/web/core/vb/database.php(1208) Exception Thrown #0 /var/www/clients/client1/web1/web/core/vb/database/mysqli.php(249): vB_Database->halt() #1 /var/www/clients/client1/web1/web/core/vb/database.php(576): vB_Database_MySQLi->execute_query(true, Object(mysqli)) #2 /var/www/clients/client1/web1/web/core/vb/db/result.php(144): vB_Database->query_read('Invalid SQL:\r\n\n...', true) #3 /var/www/clients/client1/web1/web/core/vb/db/result.php(68): vB_dB_Result->rewind() #4 /var/www/clients/client1/web1/web/core/vb/db/query/stored.php(104): vB_dB_Result->__construct(Object(vB_Database_MySQLi), '\n\t\t\t\tSELECT\n\t\t\t...', false) #5 /var/www/clients/client1/web1/web/core/vb/db/assertor.php(293): vB_dB_Query_Stored->execSQL() #6 /var/www/clients/client1/web1/web/core/vb/db/assertor.php(617): vB_dB_Assertor->assertQuery('checkFiledataCo...', Array, false) #7 /var/www/clients/client1/web1/web/core/vb/library/content/attach.php(1908): vB_dB_Assertor->getRow('checkFiledataCo...', Array) #8 /var/www/clients/client1/web1/web/core/vb/library/content/attach.php(995): vB_Library_Content_Attach->saveUpload('5556', Array, '\xFF\xD8\xFF\xE0\x00\x10JFIF\x00\x01\x01\x01\x00...', 300148, 'jpg', false) #9 /var/www/clients/client1/web1/web/core/vb/api/content/attach.php(504): vB_Library_Content_Attach->uploadAttachment('5556', Array, true, false) #10 /var/www/clients/client1/web1/web/core/vb/api/content/attach.php(344): vB_Api_Content_Attach->uploadAttachment(Array) #11 /var/www/clients/client1/web1/web/core/vb/api/wrapper.php(201): vB_Api_Content_Attach->upload(Object(stdClass)) #12 /var/www/clients/client1/web1/web/includes/api/interface/collapsed.php(105): vB_Api_Wrapper->__call('upload', Array) #13 /var/www/clients/client1/web1/web/includes/vb5/frontend/controller/uploader.php(677): Api_Interface_Collapsed->callApi('content_attach', 'upload', Array) #14 /var/www/clients/client1/web1/web/includes/vb5/frontend/controller/uploader.php(790): blueImpUploadHandler->handle_file_upload('/var/www/client...', 'WIN_20190108_23...', 273011, 'image/jpeg', 0) #15 /var/www/clients/client1/web1/web/includes/vb5/frontend/controller/uploader.php(305): blueImpUploadHandler->post() #16 /var/www/clients/client1/web1/web/index.php(74): vB5_Frontend_Controller_Uploader->actionUpload() #17 {main}
    8. Browser and Browser version used. chrome, latest version, but problem occurs on all browsers and devices
    9. Did you clear the browser cache and did the error continue? yes
    10. A list of steps that can be used to recreate the issue. I tried it here, and had no problems. But on the forum I help manage: try to upload an attachement. The first try you get the error above, but the second try with the same file it does upload. This happens since the last update
    11. Output of the error with vBulletin in Debug Mode.
    12. If the issue is an Invalid Server (500 server error) response, the web server and PHP logs that correspond with its timestamp.
    I have asked the manager of the server and database to look up any mentions in the logs, but nothing can be found

    Any advice?

  • #2
    The query is valid on my machine. However, I am using MySQL and not MariaDB. MariaDB is supposed to be a drop in replacement and fully understand MySQL syntax but I am not sure if that is 100% the case. Did you receive an email to the technical contact address specified in your /core/includes/config.php file? If you did, what is the full content of the error?

    If not, you'll have to run the query against your database using PHPMyAdmin or Adminer on your server so we can get the full error.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      Thank you! We found the problem and fixed it

      charset utf8 latin1 issue in core/vb/db/mysql/querydefs.php

      //'query_string' => "
      // SELECT
      // IF(filehash = MD5(filedata),
      1, 0) AS filehash_matches,
      // IF(filesize =
      LENGTH(filedata), 1, 0) AS filesize_matches
      // FROM {TABLE_PREFIX}filedata AS fd
      // WHERE filedataid = {filedataid}
      //",
      'query_string' => "
      SELECT
      IF(filehash =
      CAST(MD5(filedata) AS CHAR CHARACTER SET latin1), 1, 0) AS
      filehash_matches,
      IF(filesize =
      LENGTH(filedata), 1, 0) AS filesize_matches
      FROM {TABLE_PREFIX}filedata AS fd
      WHERE filedataid = {filedataid}
      ",

      Comment


      • #4
        Hmmm.

        What collation are you using currently on your tables?

        Did you switch collations on the table?

        When switching, did you use the database scripts that we provide?
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • #5
          I've asked the person who does the server and database, but no answer yet. I will let you know if I get an answer

          Comment

          Related Topics

          Collapse

          Working...
          X