Lyle-Tafoya / Steam-Categorizer

Automatically generate categories for games in your Steam library
GNU General Public License v3.0
25 stars 2 forks source link

from /usr/lib/ruby/gems/2.4.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse' #27

Closed ibrokemypie closed 6 years ago

ibrokemypie commented 7 years ago

When the store pages finish downloading, the app simply stops with not clear error message that I can tell, asside from

    from /usr/lib/ruby/gems/2.4.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse'
    from /usr/lib/ruby/gems/2.4.0/gems/steam-categorizer-0.5.10/lib/steam/vdf.rb:14:in `parse'
    from /usr/lib/ruby/gems/2.4.0/gems/steam-categorizer-0.5.10/lib/steam/categorizer.rb:139:in `generate_steam_config'
    from /usr/lib/ruby/gems/2.4.0/gems/steam-categorizer-0.5.10/exe/steam-categorizer:32:in `<top (required)>'
    from /usr/bin/steam-categorizer:22:in `load'
    from /usr/bin/steam-categorizer:22:in `<main>'

have attached the entire log log.txt

Tristor commented 7 years ago

I don't know exactly the cause here, but it looks like there's a long string value set for the parental control settings that might be breaking this because of how the parsing works. The parsing is done by taking a VDF file and converting it into JSON by using global substitutions, then running it through JSON.parse to create a map object.

In your log, it looks like the first string that triggers an error has an opening quotation mark but not an ending quotation mark, which might explain the error "Unexpected token" occurring during JSON parsing. I'm not sure what this looks like in the original VDF file. The relevant section of your log is below:

/usr/lib/ruby/gems/2.4.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse': /usr/lib/ruby/gems/2.4.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse': 784: unexpected token at '{"UserLocalConfigStore":{"ParentalSettings":{"settings":"091c46ce050000000010011a0f426c6f636b20616c6c2067616d65732a0508d30110012a0508db0110012a0508dc0110012a0508f00110012a0508840210012a0508d40210012a0508fc0210012a0508a40310012a0508b80310012a0508880410012a0508a60410012a0508b40410012a0508ba0410012a0508ec0410012a0508da0510012a0508fa0b10012a0508e01210012a0508f41210012a0508fe1210012a05089e1410012a0508a01f10012a0508d02310012a0508da2310012a0508dc2410012a0508ac2510012a0508b82610012a0508e03510012a0508f63b10012a0508fe3f10012a0508984310012a0508d44310012a0508944610012a05089e4610012a0508fc4810012a0508fe5810012a0508b25f10012a0508bc5f10012a0508e46410012a0508cc6710012a0508847a10012a0608b8850110012a060882880110012a0608aa880110012a0608be880110012a0608dc880110012a0608e6880110012a0608f0880110012a0608a2890110012a0608ac890110012a0608f48f0110012a0608bca00110012a0608f0ab0110012a0608d2b00110012a0608fab00110012a06088eb10110012a0608c2b70110012a0608b0bd0110012a0608a4c10110012a0608e0c10110012a0608b0d10110012a0608f6880210012a06088a890210012a06089e890210012a0608fa940210012a06088c9e0210012a060898a40210012a0608aca40210012a0608d8b00210012a0608d0b10210012a0608a4b90210012a0608e0be0210012a0608ecbf0210012a0608eec00210012a0608d4c20210012a0608b0c90210012a06089ecf0210012a0608a6cf0210012a0608e6d00210012a0608a0da0210012a0608b2f20210012a0608aef50210012a0608b7f50210012a0608d6f50210012a060880f70210012a0608bcfc0210012a0608f0820310012a0608be870310012a060894ef0310012a060894fe0310012a0608c2810410012a0608f4810410012a0608fe810410012a060888820410012a060880830410012a06088a830410012a0608aa8e0410012a0608f0a20410012a0608c8a70410012a0608dca70410012a0608f0a70410012a0608faa70410012a060884a80410012a0608d0cb0510012a0608dacb0510012a060880d50510012a060898e60510012a0608bc8c0610012a0608c8a10610012a0608d6b70610012a060880b90610012a06089abc0610012a0608dcc40610012a0608d0c80610012a060880d20610012a0608a0d80610012a0608fcf20610012a0608ae9b0c10012a0608ea9b0c10012a0608929c0c10012a0608be9e0c10012a060886a00c10012a06088ea40c10012a0608e2a60c10012a0608bea80c10012a060884b30c10012a0608eeb60c10012a0608cab80c10012a0608b0ba0c10012a06088cbc0c10012a06088ec70c10012a0608d6cd0c10012a060884d10c10012a0608a4d20c10012a0608c7d70c10012a0608dad90c10012a0608a6e20c10012a0608cee70c10012a0608d2ee0c10012a0608acf40c10012a0608ecf60c10012a0608c8fd0c10012a0608c0fe0c10012a0608f28d0d10012a0608ae8e0d10012a0608c28e0d10012a0608d6980d10012a0608f0a00d10012a0608b6a10d10012a0608f6a80d10012a0608fcab0d10012a0608b8ac0d10012a0608f4ac0d10012a060894b30d10012a0608f8b30d10012a0608c8c30d10012a0608a0cd0d10012a0608b4cd0d10012a0608f4cf0d10012a0608eed10d10012a060886d40d10012a060884d80d10012a0608a4d90d10012a06089cda0d10012a0608c4da0d10012a0608dcdc0d10012a060880e00d10012a06088ce10d10012a0608a8ef0d10012a0608e8f60d10012a0608a2850e10012a06088a880e10012a06089c8c0e10012a0608f88d0e10012a0608f28f0e10012a060886900e10012a060892960e10012a0608fe9f0e10012a0608f8a10e10012a0608fca30e10012a060890a40e10012a0608cea50e10012a060896a70e10012a0608faa70e10012a0608f2ad0e10012a0608e4b00e10012a0608bab40e10012a0608e6b60e10012a0608fec20e10012a0608beca0e10012a0608dace0e10012a0608acd00e10012a0608a6f00e10012a06089ef10e10012a060896f70e10012a0608a2f80e10012a0608f2f80e10012a0608d8890f10012a0608ec890f10012a0608c68f0f10012a06089e940f10012a0608f4970f10012a0608b4a40f10012a0608b2ad0f10012a06089cc00f10012a0608e2de0f10012a060888e80f10012a0608caeb0f10012a060886ec0f10012a060887ec0f10012a060888ec0f10012a060886fb0f10012a0608bcfd0f10012a0608cc8f1010012a06089e9b1010012a0608fab51010012a0608b6ca1010012a0608f4cb1010012a060886df1010012a0608bcff1010012a0608e88b1110012a0608c89e1110012a0608dea41110012a06089aa51110012a0608eaa51110012a0608a6a61110012a060898bd1110012a06088bc51110012a0608f2e01110012a0608cee21110012a060898e51110012a0608dee51110012a060896ee1110012a0608fa871210012a0608968c1210012a0608ce8f1210012a0608bc901210012a0608ca921210012a0608e89c1210012a0608d0b31210012a0608bab71210012a0608acba1210012a06089ec21210012a0608a2ce1210012a0608e2df1210012a0608b6f61210012a0608ecf81210012a0608a0fa1210012a0608b8811310012a060886951310012a0608b8a91310012a0608b0af1310012a06088eb21310012784: unexpected token at '{"UserLocalConfigStore":{"ParentalSettings":{"settings":"091c46ce050000000010011a0f426c6f636b20616c6c2067616d65732a0508d30110012a0508db0110012a0508dc0110012a0508f00110012a0508840210012a0508d40210012a0508fc0210012a0508a40310012a0508b80310012a0508880410012a0508a60410012a0508b40410012a0508ba0410012a0508ec0410012a0508da0510012a0508fa0b10012a0508e01210012a0508f41210012a0508fe1210012a05089e1410012a0508a01f10012a0508d02310012a0508da2310012a0508dc2410012a0508ac2510012a0508b82610012a0508e03510012a0508f63b10012a0508fe3f10012a0508984310012a0508d44310012a0508944610012a05089e4610012a0508fc4810012a0508fe5810012a0508b25f10012a0508bc5f10012a0508e46410012a0508cc6710012a0508847a10012a0608b8850110012a060882880110012a0608aa880110012a0608be880110012a0608dc880110012a0608e6880110012a0608f0880110012a0608a2890110012a0608ac890110012a0608f48f0110012a0608bca00110012a0608f0ab0110012a0608d2b00110012a0608fab00110012a06088eb10110012a0608c2b70110012a0608b0bd0110012a0608a4c10110012a0608e0c10110012a0608b0d10110012a0608f6880210012a06088a890210012a06089e890210012a0608fa940210012a06088c9e0210012a060898a40210012a0608aca40210012a0608d8b00210012a0608d0b10210012a0608a4b90210012a0608e0be0210012a0608ecbf0210012a0608eec00210012a0608d4c20210012a0608b0c90210012a06089ecf0210012a0608a6cf0210012a0608e6d00210012a0608a0da0210012a0608b2f20210012a0608aef50210012a0608b7f50210012a0608d6f50210012a060880f70210012a0608bcfc0210012a0608f0820310012a0608be870310012a060894ef0310012a060894fe0310012a0608c2810410012a0608f4810410012a0608fe810410012a060888820410012a060880830410012a06088a830410012a0608aa8e0410012a0608f0a20410012a0608c8a70410012a0608dca70410012a0608f0a70410012a0608faa70410012a060884a80410012a0608d0cb0510012a0608dacb0510012a060880d50510012a060898e60510012a0608bc8c0610012a0608c8a10610012a0608d6b70610012a060880b90610012a06089abc0610012a0608dcc40610012a0608d0c80610012a060880d20610012a0608a0d80610012a0608fcf20610012a0608ae9b0c10012a0608ea9b0c10012a0608929c0c10012a0608be9e0c10012a060886a00c10012a06088ea40c10012a0608e2a60c10012a0608bea80c10012a060884b30c10012a0608eeb60c10012a0608cab80c10012a0608b0ba0c10012a06088cbc0c10012a06088ec70c10012a0608d6cd0c10012a060884d10c10012a0608a4d20c10012a0608c7d70c10012a0608dad90c10012a0608a6e20c10012a0608cee70c10012a0608d2ee0c10012a0608acf40c10012a0608ecf60c10012a0608c8fd0c10012a0608c0fe0c10012a0608f28d0d10012a0608ae8e0d10012a0608c28e0d10012a0608d6980d10012a0608f0a00d10012a0608b6a10d10012a0608f6a80d10012a0608fcab0d10012a0608b8ac0d10012a0608f4ac0d10012a060894b30d10012a0608f8b30d10012a0608c8c30d10012a0608a0cd0d10012a0608b4cd0d10012a0608f4cf0d10012a0608eed10d10012a060886d40d10012a060884d80d10012a0608a4d90d10012a06089cda0d10012a0608c4da0d10012a0608dcdc0d10012a060880e00d10012a06088ce10d10012a0608a8ef0d10012a0608e8f60d10012a0608a2850e10012a06088a880e10012a06089c8c0e10012a0608f88d0e10012a0608f28f0e10012a060886900e10012a060892960e10012a0608fe9f0e10012a0608f8a10e10012a0608fca30e10012a060890a40e10012a0608cea50e10012a060896a70e10012a0608faa70e10012a0608f2ad0e10012a0608e4b00e10012a0608bab40e10012a0608e6b60e10012a0608fec20e10012a0608beca0e10012a0608dace0e10012a0608acd00e10012a0608a6f00e10012a06089ef10e10012a060896f70e10012a0608a2f80e10012a0608f2f80e10012a0608d8890f10012a0608ec890f10012a0608c68f0f10012a06089e940f10012a0608f4970f10012a0608b4a40f10012a0608b2ad0f10012a06089cc00f10012a0608e2de0f10012a060888e80f10012a0608caeb0f10012a060886ec0f10012a060887ec0f10012a060888ec0f10012a060886fb0f10012a0608bcfd0f10012a0608cc8f1010012a06089e9b1010012a0608fab51010012a0608b6ca1010012a0608f4cb1010012a060886df1010012a0608bcff1010012a0608e88b1110012a0608c89e1110012a0608dea41110012a06089aa51110012a0608eaa51110012a0608a6a61110012a060898bd1110012a06088bc51110012a0608f2e01110012a0608cee21110012a060898e51110012a0608dee51110012a060896ee1110012a0608fa871210012a0608968c1210012a0608ce8f1210012a0608bc901210012a0608ca921210012a0608e89c1210012a0608d0b31210012a0608bab71210012a0608acba1210012a06089ec21210012a0608a2ce1210012a0608e2df1210012a0608b6f61210012a0608ecf81210012a0608a0fa1210012a0608b8811310012a060886951310012a0608b8a91310012a0608b0af1310012a06088eb21310012a060890c71310012a060890cc1310012a0608ead11310012a060888bb1410012a0608c6bc1410012a0608c8d61410012a060894961510012a06089e891610012a0608c29b1610012a0608b4b716100130043a0848bb6a7949f28cc042206439ebde23524759b43bc8ffe0dfcb14f3c709839378d03e98e6414ef04ae4fc48005080205a12636f6f6c6f316d6340676d61696c2e636f6d","Signature":"7ae2a4d9305e6aa6371cc8b3fe09389bf7218923501976af26c3a50fd90ee9239d14f14adc002862b39c68614c7d7f162c7d05247b06350c14f7346be94d87d94083ea11a966239ba9482a4ab2c5a00ad967889753287bb10568df698d382e72176ef955b0c201f409abad69bf72d248e3905fd192f427b9f8303fa8688faeb64cc7ad6d76061bc1486685f96a54a8a708e3e06277a345ac9c3e91c4784072b830f5270ccac9f49751ea840dc7a8e2d66408708289188c9bcbf5ca83a76b418e8a9bb882cf105fa12275d8fad40d351435ef36b282917dab20bb4ba5f4fb541b7d08b44e076bbc6597d3518b4250b5697488bd7ece7d0f63ec4d5b4b654a6520" (JSON::ParserError)

I did not see this error myself, but I don't have any parental control settings enabled on my Steam account.

ibrokemypie commented 7 years ago

Neither do I... What should I do about this?

Tristor commented 7 years ago

I'm not the original author of the project, but I was looking into writing unit tests for the VDF parser specifically to see if I can find the case where this is failing. Can you send me a copy of your sharedconfig.vdf? If so, I can look into this further. I may also temporarily enable parental control settings on my Steam account to see if I can replicate, but I'm not sure what specific settings you used and it may be a very narrow case.

I see you also use Keybase, you can share the file with me there to transmit it securely or email it to me using the PGP key on my Keybase profile and the email address on my Github profile.

Thanks.

Lyle-Tafoya commented 7 years ago

A possible temporary workaround if you are not using your parental control settings would be to edit the sharedconfig.vdf file and remove the parental settings section. I do not know how that will affect things though as that section is not present in my config file. Although, it is better if some tests can be performed with your sharedconfig.vdf file to find the root cause.

Lyle-Tafoya commented 6 years ago

After further investigation I have determined that the config file it is attempting to parse is not the correct one that this program is intended to work with.

This program is intended to work with the sharedconfig.vdf file which can be found at a file path similar to ~/.steam/steam/userdata/65357252/7/remote/sharedconfig.vdf

The file it is failing to parse here looks to be the localconfig.vdf file which is found at a file path similar to ~/.steam/steam/userdata/65357252/config/localconfig.vdf

However, this still represents an issue with the vdf parsing logic so I will keep this bug report open until it has been resolved.