@pattu posted a new topic, subject "Debug error: ADOConnection._Execute(INSERT INTO controlled_vocabs". It read:

   Hi,  
    I have upgraded OJS from 3.0.1 or 302.284.5466 recently. The site is working fine, but the error file size is increasing day by day. I have enabled the debug ON and found the following messages:
    
    > DOConnection._Execute(INSERT INTO controlled_vocabs (symbolic, assoc_type, assoc_id) VALUES (‘submissionKeyword', 1048588, 659)) % line 1217, file: adodb.inc.php
    > 
    > ADOConnection.Execute(INSERT INTO controlled_vocabs (symbolic, assoc_type, assoc_id) VALUES (‘submissionKeyword', 1048588, 659), Array[1]) % line 229, file: DAO.inc.php
    > 
    > DAO.update(INSERT INTO controlled_vocabs (symbolic, assoc_type, assoc_id) VALUES (?, ?, ?), Array[3], true, false) % line 99, file: ControlledVocabDAO.inc.php
    > 
    > ControlledVocabDAO.insertObject(Object:ControlledVocab, false) % line 60, file: ControlledVocabDAO.inc.php
    > 
    > ControlledVocabDAO._build(submissionKeyword, 1048588, 659) % line 31, file: SubmissionKeywordDAO.inc.php
    
    The above block of messages were repeated 220 times and below that the OJS website has loaded correctly. Why this error messages are occurring?
    
    Thanks  
    Thripthi

@asmecher (Alec Smecher) replied

    Hi @pattu,
    
    The `debug` option should be left Off, or else you'll get a huge amount of log information. What do you see appearing in the logs when the `debug` option is left `Off`?
    
    Regards,  
    Alec Smecher  
    Public Knowledge Project Team

So @kksabu (Sabu K K) replied

    When the debug option is off, error messages appear like:
    
    > [29-Jul-2020 06:23:37 America/Boise] PHP Warning: Constants may only evaluate to scalar values in /home1/thescif5/public_html/horizonepublishing/test/lib/pkp/classes/db/DBConnection.inc.php on line 17  
    >  [29-Jul-2020 06:23:37 America/Boise] PHP Parse error: syntax error, unexpected ‘?', expecting variable (T_VARIABLE) in /home1/thescif5/public_html/horizonepublishing/test/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374
    
    So, I have disabled Registration Notification plugin. ORCID plugin was not working as desired which has also been disables. Due to these, around 2MB of error messages accumulated per day has been avoided.

So @asmecher (Alec Smecher) replied

    Hi @kksabu,
    
    This error:
    [code] 
         PHP Parse error: syntax error, unexpected ‘?', expecting variable
        
    [/code]
    
    …indicates that you're running a version of PHP that's too old for that code. Double-check your PHP version against the base requirements in `docs/README.md`.
    
    Regards,  
    Alec Smecher  
    Public Knowledge Project Team

So @pattu replied

    PHP version changed to 7.4. I guess it was 7.3 earlier.

@e-smartsolution (Moussa) replied

    Hi  
    Maybe this section is closed. I' using OJS version  
    Version: Current version: 302.284.5466 (July 30, 2020 - 08:24 AM)  
    PHP version :7.2.31  
    Database server version 5.7.12
    
    I found out every single when the user update the submission this page, OJS is trying to insert again some data on this table “controlled_vocabs”
    
    So to test what was going on I deleted the key “controlled_vocab_symbolic” and every single a user reloads the page:  
    https://journal.iwc.int/index.php/jcrm/submissions  
    is keep inserting a lot of records…
    
    Why is inserting if it suppose to only load a list of “submissions” (  
    My Queue, Unassigned All Actie Archives)

Then @asmecher (Alec Smecher) said

    Hi @e-smartsolution,
    
    The behaviour you describe is not a problem – it's intentional – and you definitely shouldn't delete that index!
    
    Regards,  
    Alec Smecher  
    Public Knowledge Project Team

Then @e-smartsolution (Moussa) said

    Hi thank you, I'm not sure if I fully understand your message…  
    What I know so far is - Testing the OJS on different environments:  
    1 - When the index “controlled_vocab_symbolic” is on I am receiving this message:
    
    ADOConnection._Execute(INSERT INTO controlled_vocabs (symbolic, assoc_type, assoc_id) VALUES (‘submissionAgency', 1048588, 43)) % line 1217, file: adodb.inc.php
    
    I found out every single when the submission page is loading is trying to insert the same record:  
    I checked: SELECT COUNT( _), assoc_type FROM`controlled_vocabs`  
    COUNT(_) assoc_type  
    240 1048588
    
    Checking where this assoc_type is coming from, I found on this file “3.2.0_versioning.xml”  
    …  
      
    UPDATE controlled_vocabs AS cv,  
    submissions AS s  
    SET cv.assoc_type = 1048588, cv.assoc_id = s.current_publication_id  
    WHERE cv.assoc_type = 1048585 AND s.submission_id = cv.assoc_id  
      
    …
    
    Note: We updated version to the version 3 and our journal was working fine, we have 2 issues published with DOI… J. Cetacean Res. Manage.  
    Cheers

After which, @asmecher (Alec Smecher) added

    Hi @e-smartsolution,
    
    OJS intentionally uses an index collision to check whether a value is already created there. If there is, it uses it; if there's not, it creates one. It seems that some database servers are now starting to complain about this where they previously did not; you can change the behaviour to avoid this by applying this change: Avoid index collisions if possible · pkp/pkp-lib@b193290 · GitHub  
    See also: DB Error after upgrading to OJS 302.284.5466 - #5 by Tarcisio_Pereira
    
    Regards,  
    Alec Smecher  
    Public Knowledge Project Team

After which, @e-smartsolution (Moussa) added

    Thank you @asmecher, I believe the next issue is related to what I have ready reported:  
    …  
    Failed to load resource: the server responded with a status of 500 ()  
    pkp.min.js?v=302.284.5466:316 Uncaught TypeError: Cannot read property ‘trigger' of undefined  
    at b.a.pkp.controllers.modal.ModalHandler.modalOpen (pkp.min.js?v=302.284.5466:316)  
    at o.ajaxErrorCallback (build.js?v=302.284.5466:6)  
    at Object.error (build.js?v=302.284.5466:6)  
    at u (jquery.min.js?v=302.284.5466:2)  
    at Object.fireWith [as rejectWith] (jquery.min.js?v=302.284.5466:2)  
    at k (jquery.min.js?v=302.284.5466:2)  
    at XMLHttpRequest. (jquery.min.js?v=302.284.5466:2)  
    pkp.min.js?v=302.284.5466:315 Uncaught TypeError: Cannot read property ‘addClass' of undefined  
    at pkp.min.js?v=302.284.5466:315  
    pkp.min.js?v=302.284.5466:315 Uncaught TypeError: Cannot read property ‘focus' of undefined  
    at pkp.min.js?v=302.284.5466:315  
    …  
    I have double-checked it, this error happens with submission with status 4(archives tab)
    
    https://journal.iwc.int/index.php/jcrm/api/v1/_submissions?status=1 → OK, Not error  
    https://journal.iwc.int/index.php/jcrm/api/v1/_submissions?status=2 → Ok, not error
    
    https://journal.iwc.int/index.php/jcrm/api/v1/_submissions?status=4 → Is not working  
    …  
    Slim Application Error  
    A website error has occurred. Sorry for the temporary inconvenience.  
    …
    
    Thank you very much your support!
    
    Cheers

Then @e-smartsolution (Moussa) said

    Hello @asmecher  
    I believe our journal(submission) is working after update this…
    
    you can change the behaviour to avoid this by applying this change: Avoid index collisions if possible · pkp/pkp-lib@b193290 · GitHub
    
    Cheers


{'source': 'discourse', 'url': 'https://forum.pkp.sfu.ca/t/debug-error-adoconnection-execute-insert-into-controlled-vocabs/62332', 'title': 'Debug error: ADOConnection._Execute(INSERT INTO controlled_vocabs', 'views': 602, 'has_accepted_answer': False, 'word_count': 1077, 'like_count': 1, 'reply_count': 6, 'participant_count': 4, 'posts': 11, 'tags': '', 'author': '@pattu', 'participants': '@pattu, @asmecher (Alec Smecher), @kksabu (Sabu K K), @e-smartsolution (Moussa)', 'image_url': [None], 'created_at': '2020-08-15T18:54:33.197Z', 'last_posted_at': '2020-10-06T12:56:50.399Z'}