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

paket install fails due to JSON parsing error #1699

Closed
vain0x opened this issue May 22, 2016 · 18 comments
Closed

paket install fails due to JSON parsing error #1699

vain0x opened this issue May 22, 2016 · 18 comments

Comments

@vain0x
Copy link
Contributor

vain0x commented May 22, 2016

Description

Please see repro steps.

Repro steps

Locate paket.exe (from Paket latest release). Then run these commands:

paket init
echo github vain0/abdata >> paket.dependencies
paket install

(Note at 2016/May/24 07:55 JST: I use an alias that "paket=.paket\paket.exe". So please read them as .paket\paket.exe init and .paket\paket.exe install.)

And I got this error:

Paket failed with:
        After parsing a value an unexpected character was encountered: s. Path 'files[7].patch', line 1, position 10814.

Known workarounds

github vain0/hsp_green also invoked a similar error. Then I put paket.dependencies next to "src/all.hsp" (a file in the repository) and rewrite my paket.dependencies like this.

github vain0/hsp_green src/all.hsp

Then paket first fetches "src/all.hsp", and then it fetches all files in the repository due to the transitive dependency written in that paket.dependencies.

Other cases

  • Failure cases:
    • github/zeo_five_hsp (contains no files related to Paket)
      • Error message: Bad JSON escape sequence: \・. Path 'files[9].patch', line 1, position 3 5330.
    • github/speed_fs (contains paket.dependencies in the root)
      • Error message: After parsing a value an unexpected character was encountered: s. Path 'files[0].patch', line 1, position 5073.
  • Success cases:
    • github vain0/git_edit (which contains no files related to paket), ``github vain0/rss_reader_fs` (which contains paket.dependencies), etc

Related information

  • Windows 10
  • .NET framework 4.6
  • Paket 2.65.2.0
@vain0x
Copy link
Contributor Author

vain0x commented May 23, 2016

This is because github API returns broken JSON containing non-unicode text (SHIFT_JIS encoding). (Such as https://api.github.com/repos/vain0/hsp_green/commits/master)

@smoothdeveloper
Copy link
Contributor

@vain0 I assume paket doesn't handle json parsing itself but depends on 3rd part library (I believe Newtonsoft.Json), maybe you should inquire there or check with github what can be done with the json itself?

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

I see. Thank you for your suggestion.

@vain0x vain0x closed this as completed May 24, 2016
@forki
Copy link
Member

forki commented May 24, 2016

I think I still want to understand what's going wrong here.

@forki forki reopened this May 24, 2016
@forki
Copy link
Member

forki commented May 24, 2016

Paket install on a dependencies file containing

github vain0/abdata 

worked for me. Can you create a zip that reproduces?

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

Okay, here you are.

repro_1699.zip

I've just now confirmed that .paket\paket.exe install produces the same error as I wrote above.

(I added a small note to the first comment.)

@forki
Copy link
Member

forki commented May 24, 2016

image

still can't reproduce with latest paket.

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

Thank you. It's mysterious. Only my environment...?

@forki
Copy link
Member

forki commented May 24, 2016

I wonder if someone else can reproduce.

Whatever the server returns to you is probably invalid json, but for me it returns the right thing.

dog

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

Hmm... Let's wait for someone else try the repro.

@forki
Copy link
Member

forki commented May 24, 2016

Maybe there is a firewall blocking it?
On May 24, 2016 1:25 PM, "vain0" [email protected] wrote:

Hmm... Let's wait for someone else try the repro.


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#1699 (comment)

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

I've tried to paket install with Windows Firewall & Anti-virus disabled but the same error occurred.

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

I asked my twitter account's followers to do repro steps and one could: https://twitter.com/htid46/status/735076020584251394 (written in Japanese)

According to them, because Windows's standard char code is shift_jis (? I don't understand yet.)

@forki
Copy link
Member

forki commented May 24, 2016

Can you please tweet same thing in English? Will retweet

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

Tweeted: https://twitter.com/ue_dai/status/735080574314905601 and https://twitter.com/ue_dai/status/735081112205025280 .

They also wrote a note: https://gist.github.com/hafuu/1e6cf81c0d08636ee86b5d0de3c55bb4

And they solved this issue immediately. I'll open a PR instead of them.

@vain0x
Copy link
Contributor Author

vain0x commented May 24, 2016

I forgot to say I built the PR version Paket and confirmed it succeeded to paket install.

@forki forki closed this as completed in f2fece2 May 24, 2016
@forki
Copy link
Member

forki commented May 24, 2016

great work. thanks

@smoothdeveloper
Copy link
Contributor

https://twitter.com/harrisj/status/734857735393714176

When do you talk to your children about character encodings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants