-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Fatal error: Uncaught ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in #9535
PHP Fatal error: Uncaught ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in #9535
Comments
@jonasraoni, the error message seems to be coming from the PKP|PN plugin. Can you have a look? |
@asmecher The problems on the PN plugin have been fixed, we just need to merge the pending PRs and do a release. |
@janevsky Thanks for the report! Could you show us what do you have on the line 85 of this file I guess you have this code, right? If yes, then looks like your submission file has with an invalid stage, and I'm not sure it's possible to fix it properly 🤔 @asmecher What do you think about updating empty/invalid file stages to And as a fix for the Native plugin, we can skip such files. |
@jonasraoni That's exacaly what i have on line 85 I did a compare, the full code seems the same. This is the other day in the morning with the scheduled tasks: |
@jonasraoni okay thank you, i will be waiting for a replay. |
update: There were no errors in my php log on the new submission this morning, the doi was deposited, usage stats updated, everything was done the same like the submission before. |
…the Native XML plugin
…35-skip-invalid-submission-files##
…the Native XML plugin
…35-skip-invalid-submission-files##
@janevsky I've left a workaround here, which will just skip files that have an invalid file stage (the "file stage" defines if the file is part of the copyediting, production, ...): https://github.com/pkp/pkp-lib/pull/9537/files This query should bring the bad submission files: select sf.submission_id, f.path
from submission_files sf
inner join files f on f.file_id = sf.file_id
where sf.file_stage = 0 You can take a look at the submission and the physical file... Then try to understand if the file is duplicated on the user interface (in case it was the result of a half-baked operation and the user re-uploaded) or if it's just went missing from one of the stages. |
@jonasraoni thank you for the workaround, I've updated the two files, i will keep an eye on the PHP error log when we publish a new submission. I believe it wont have any problems. For the query, here are the results: Thank you very much! |
@jonasraoni now a new error poped, here is the php error log from this morning: |
I've looked through a number of databases from various versions of OJS and only found two databases with
I think tracking it down more specifically would require a deep-dive into OJS 2.x history, and I don't think that would be worthwhile. So while I can't say 100% that it won't cause side-effects, I'd support what you propose, Jonas! |
@jonasraoni Forgot to mention that I did a reset on the PKP PN plugin when I did the changes that you proposed, and the next morning i got the php error above and here is the status now: |
@janevsky Sorry for the delay, but I guess you have a different issue now. You can try to replace the following line in the file
By error_log(print_r($errors = libxml_get_errors(), true)); Then try to export the problematic issue using the Tools > Import/Export > Native XML Plugin > Export Issues. Send us the error that you see on the screen + any helpful error message that you may find at the server's error log. |
@jonasraoni I did what you suggested, here are the logs: php error log: `[26-Jan-2024 10:27:47 Europe/Ljubljana] Array
) [26-Jan-2024 10:27:47 Europe/Ljubljana] PHP Fatal error: Uncaught Exception: Could not convert selected objects. in /home/jhrs/domains/jhrs.almamater.si/public_html/lib/pkp/classes/plugins/ImportExportPlugin.inc.php:182 Apache logs: |
…the Native XML plugin
…the Native XML plugin
…35-skip-invalid-submission-files##
…35-skip-invalid-submission-files##
…35-skip-invalid-submission-files##
…the Native XML plugin
…invalid-submission-files##
…invalid-submission-files##
…invalid-submission-files##
…p-invalid-submission-files #9535 Skipped submission files that have an invalid file s…
…the Native XML plugin
Describe the bug
We published another issue yesterday night and a new submission, this morning i wanted to reset the counter on the scheduled tasks and did the following:
To Reproduce
I believe that it will be the same as i described above, did not try, i will leave it like this until tomorrow to see if it happens again.
What application are you using?
OJS version 3.3.0-14
PHP version 8.0.30
Additional information
Refreshing the page once got me the invalid XML error on the bottom, i've checked the scheduled_tasks it contained only 2 out of 8 rows, plugins.generic.usageStats.UsageStatsLoader and plugins.generic.pln.classes.tasks.Depositor, the rest were loaded on my second refresh.
The submission successfully deposited the doi and the doi link is working. The view/download counter changed also.
Not sure if the php warnings are related to this but i will post what i got when i reloaded.
PHP error log:
[24-Nov-2023 06:49:57 Europe/Ljubljana] PHP Warning: Undefined array key 0 in /home/XXX/domains/XXX/public_html/lib/pkp/plugins/importexport/native/filter/SubmissionFileNativeXmlFilter.inc.php on line 85 [24-Nov-2023 06:49:57 Europe/Ljubljana] PHP Warning: Undefined array key 0 in /home/XXX/domains/XXX/public_html/lib/pkp/plugins/importexport/native/filter/SubmissionFileNativeXmlFilter.inc.php on line 85 [24-Nov-2023 06:49:57 Europe/Ljubljana] PHP Warning: Attempt to read property "documentElement" on null in /home/XXX/domains/XXX/public_html/plugins/importexport/native/filter/IssueNativeXmlFilter.inc.php on line 204 [24-Nov-2023 06:49:57 Europe/Ljubljana] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/XXX/domains/XXX/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php:219) in /home/XXX/domains/XXX/public_html/lib/pkp/classes/plugins/ImportExportPlugin.inc.php on line 171 [24-Nov-2023 06:49:57 Europe/Ljubljana] PHP Warning: Undefined variable $exportXml in /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/DepositPackage.inc.php on line 328 [24-Nov-2023 06:49:57 Europe/Ljubljana] PHP Fatal error: Uncaught ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/DepositPackage.inc.php:411 Stack trace: #0 /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/DepositPackage.inc.php(411): DOMDocument->loadXML() #1 /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/DepositPackage.inc.php(328): DepositPackage->_cleanFileList() #2 /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/DepositPackage.inc.php(540): DepositPackage->generatePackage() #3 /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/tasks/Depositor.inc.php(225): DepositPackage->packageDeposit() #4 /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/tasks/Depositor.inc.php(127): Depositor->_processNeedPackaging() #5 /home/XXX/domains/XXX/public_html/lib/pkp/classes/scheduledTask/ScheduledTask.inc.php(146): Depositor->executeActions() #6 /home/XXX/domains/XXX/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php(259): ScheduledTask->execute() #7 [internal function]: PKPAcronPlugin->shutdownFunction() #8 {main} thrown in /home/XXX/domains/XXX/public_html/plugins/generic/pln/classes/DepositPackage.inc.php on line 411
If more information is needed i can provide.
The text was updated successfully, but these errors were encountered: