Skip to content
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

ValueError: mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "" given #5639

Open
kghbln opened this issue May 18, 2024 · 1 comment
Labels
bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error

Comments

@kghbln
Copy link
Member

kghbln commented May 18, 2024

Setup

Issue

When running php /.../w/extensions/SemanticMediaWiki/maintenance/rebuildData.php -v --report-runtime --with-maintenance-log --ignore-exceptions --skip-properties I get for a file page

   ... updating 443570    [S: Bestand:Ives_web.jpg]
[e85e380d76c491c57f20bce4] [no req]   ValueError: mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "" given

Backtrace

from /.../w/extensions/SemanticMediaWiki/src/Tesa/src/Normalizer.php(72)
#0 /.../w/extensions/SemanticMediaWiki/src/Tesa/src/Normalizer.php(72): mb_strtolower()
#1 /.../w/extensions/SemanticMediaWiki/src/Tesa/src/Sanitizer.php(146): Onoi\Tesa\Normalizer::toLowercase()
#2 /.../w/extensions/SemanticMediaWiki/src/SQLStore/QueryEngine/Fulltext/TextSanitizer.php(103): Onoi\Tesa\Sanitizer->toLowercase()
#3 /.../w/extensions/SemanticMediaWiki/src/SQLStore/QueryEngine/Fulltext/SearchTableUpdater.php(154): SMW\SQLStore\QueryEngine\Fulltext\TextSanitizer->sanitize()
#4 /.../w/extensions/SemanticMediaWiki/src/SQLStore/QueryEngine/Fulltext/TextChangeUpdater.php(228): SMW\SQLStore\QueryEngine\Fulltext\SearchTableUpdater->update()
#5 /.../w/extensions/SemanticMediaWiki/src/SQLStore/QueryEngine/Fulltext/TextChangeUpdater.php(119): SMW\SQLStore\QueryEngine\Fulltext\TextChangeUpdater->doUpdateFromChangeDiff()
#6 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks.php(1382): SMW\SQLStore\QueryEngine\Fulltext\TextChangeUpdater->pushUpdates()
#7 /.../w/includes/HookContainer/HookContainer.php(338): SMW\MediaWiki\Hooks->onAfterDataUpdateComplete()
#8 /.../w/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#9 /.../w/extensions/SemanticMediaWiki/src/SQLStore/SQLStoreUpdater.php(291): MediaWiki\HookContainer\HookContainer->run()
#10 /.../w/extensions/SemanticMediaWiki/src/SQLStore/SQLStore.php(318): SMW\SQLStore\SQLStoreUpdater->doDataUpdate()
#11 /.../w/extensions/SemanticMediaWiki/src/Store.php(237): SMW\SQLStore\SQLStore->doDataUpdate()
#12 /.../w/extensions/SemanticMediaWiki/src/DataUpdater.php(420): SMW\Store->updateData()
#13 /.../w/extensions/SemanticMediaWiki/src/DataUpdater.php(297): SMW\DataUpdater->updateData()
#14 /.../w/extensions/SemanticMediaWiki/src/DataUpdater.php(197): SMW\DataUpdater->runUpdate()
#15 /.../w/extensions/SemanticMediaWiki/src/ParserData.php(469): SMW\DataUpdater->doUpdate()
#16 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(305): SMW\ParserData->updateStore()
#17 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(218): SMW\MediaWiki\Jobs\UpdateJob->updateStore()
#18 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(139): SMW\MediaWiki\Jobs\UpdateJob->parse_content()
#19 /.../w/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/UpdateJob.php(94): SMW\MediaWiki\Jobs\UpdateJob->doUpdate()
#20 /.../w/extensions/SemanticMediaWiki/src/SQLStore/Rebuilder/Rebuilder.php(247): SMW\MediaWiki\Jobs\UpdateJob->run()
#21 /.../w/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(472): SMW\SQLStore\Rebuilder\Rebuilder->rebuild()
#22 /.../w/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(385): SMW\Maintenance\DataRebuilder->doUpdateById()
#23 /.../w/extensions/SemanticMediaWiki/src/Maintenance/DataRebuilder.php(224): SMW\Maintenance\DataRebuilder->rebuildAll()
#24 /.../w/extensions/SemanticMediaWiki/maintenance/rebuildData.php(198): SMW\Maintenance\DataRebuilder->rebuild()
#25 /.../w/maintenance/includes/MaintenanceRunner.php(309): SMW\Maintenance\rebuildData->execute()
#26 /.../w/maintenance/doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run()
#27 /.../w/extensions/SemanticMediaWiki/maintenance/rebuildData.php(294): require_once(string)
#28 {main}

The only way to move forward is to do php /.../w/extensions/SemanticMediaWiki/maintenance/rebuildData.php -v --report-runtime --with-maintenance-log --ignore-exceptions --skip-properties -s 443572

@kghbln kghbln added the bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error label May 18, 2024
@kghbln
Copy link
Member Author

kghbln commented May 18, 2024

The entity lookup for the transgressing ID 443571 shows:

{
    "443571": {
        "smw_id": "443571",
        "smw_title": "Foto_tin_Ives.jpg",
        "smw_namespace": "6",
        "smw_iw": "",
        "smw_subobject": "",
        "smw_sortkey": "Foto tin Ives.jpg",
        "smw_proptable_hash": "...",
        "smw_rev": "1919224",
        "smw_touched": "20210622153027"
    }
}

ID "443571" has at least one active reference:

{
    "443571": {
        "smw_fpt_mdat": {
            "s_id": "443571"
        },
        "smw_fpt_attch_link": {
            "s_id": "139357"
        },
        "smw_fpt_cdat": {
            "s_id": "443571"
        },
        "smw_fpt_ledt": {
            "s_id": "443571"
        },
        "smw_fpt_media": {
            "s_id": "443571"
        },
        "smw_fpt_mime": {
            "s_id": "443571"
        },
        "smw_ftp_sesp_revid": {
            "s_id": "443571"
        },
        "smw_ftp_sesp_cuser": {
            "s_id": "443571"
        },
        "smw_ft_search": {
            "s_id": "443571",
            "p_id": "1107344",
            "o_text": "bitmap"
        }
    }
}

Edit also happening for ID 445244 and probably many more. Let's see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error
Projects
None yet
Development

No branches or pull requests

1 participant