Appcenter: Releasing app via cURL fails

Created on 22 Mar 2019  Â·  5Comments  Â·  Source: microsoft/appcenter

What App Center service does this affect?
Distribution

Describe the bug
When I trigger a release via cURL it fails with a release notes in markdown. When pasting the same release notes via the web interface it works.

To Reproduce
This is the output I get from the commandline:


curl -X PATCH --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-API-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' -d '{ "destination_name": "Developers", "release_notes": "## Build #927 (2019-03-20 12:27)

Infra ZZ-4437 Remove XYZChangeSynchroListEntryNameAction (Aaaaa Bbbbbbb)

Build #926 (2019-03-20 09:22)

Bug ZZ-5124 Use internal order for exporting documents (Sssssssss Ppppppppp)

Build #925 (2019-03-19 16:23)

Bug ZZ-4865 Fix NSInternalInconsistencyException in - [XYZComputationQueryTerm initWithResultType:operation:arguments:subTerms:context:], line 926 (Sssssss Mmmmmmm)
Bug ZZ-4767 Import: sync points should shift position if at end (Aaaaa Bbbbbbb)

Build #924 (2019-03-19 16:03)

Bug ZZ-5128 Fix NSInvalidArgumentException in - [XYZAbstractLinkInspector deleteLinks:], line 470 (Sssssss Mmmmmmm)
Bug ZZ-4766 Context menu in group filter area background should not be for selected entity (Sssssss Mmmmmmm)

Build #923 (2019-03-19 11:05)

No JIRA issues changed

Build #922 (2019-03-18 11:44)

Bug ZZ-5123 Global Filter: Filter quotation of documents in group ... is on the wrong position (Sssssss Mmmmmmm)

Build #921 (2019-03-18 11:20)

QA Issue ZZ-5058 Crash in Code-Document-Table (Sssssss Mmmmmmm)

Build #920 (2019-03-18 09:31)

Infra ZZ-4987 Migrate to repair corrupt F4 imports (Mmmmmm Kkkkkkkkk)

Build #919 (2019-03-15 15:10)

Story ZZ-4499 Refactor and improve localizations
Sub-task ZZ-5102 Update Chinese translation (Fffffffff Mmmmmmmm)
Sub-task ZZ-4702 Brazilian Portuguese translation (Fffffffff Mmmmmmmm)

Build #918 (2019-03-15 14:27)

Bug ZZ-5119 QDPX Import from Win fails when there is no base path given. (Sssssssss Ppppppppp)

Build #917 (2019-03-15 13:06)

Story ZZ-4270 Endnote import (Reference Manager Data Import) (Aaaaa Bbbbbbb)

Build #916 (2019-03-15 12:59)

Story ZZ-5085 QDPX - Ready for Release (Sssssssss Ppppppppp)
Story ZZ-4838 QDPX Ready for User Testing
Sub-task ZZ-4937 Crash when trying to import non-existing file without sources folder. (Sssssssss Ppppppppp)
…

Build #915 (2019-03-15 11:16)

No JIRA issues changed

Build #914 (2019-03-15 10:59)

No JIRA issues changed

Build #19

No JIRA issues changed
" }' 'https://api.appcenter.ms/v0.1/apps/mac-ci-yyyyyyy.com/YYYYYYY.yy-Mac-AC-Dev/releases/7'


Returns:





Error

SyntaxError: Unexpected token 
in JSON at position 88
   at JSON.parse (<anonymous>)
   at parse (/data/node_modules/body-parser/lib/types/json.js:89:19)
   at /data/node_modules/body-parser/lib/read.js:121:18
   at invokeCallback (/data/node_modules/raw-body/index.js:224:16)
   at done (/data/node_modules/raw-body/index.js:213:7)
   at IncomingMessage.onEnd (/data/node_modules/raw-body/index.js:273:7)
   at emitNone (events.js:111:20)
   at IncomingMessage.emit (events.js:208:7)
   at endReadableNT (_stream_readable.js:1064:12)
   at _combinedTickCallback (internal/process/next_tick.js:139:11)
   at process._tickDomainCallback (internal/process/next_tick.js:219:9)



When I pass a short string like "something" as the release note it works so it must have something to do with the characters used in the markdown release notes.

Expected behavior
The error message should be more verbose if unexpected characters are passed via an upload command.

Desktop (please complete the following information):

  • OS: macOS 10.14.3, cURL version 7.54.0

Additional context
I also noticed that the 5000 character limit stated on the appcenter portal when entering the releae notes is not correct, it only allows 4000 characters. The current character count is also not shown, so it is kind of a guess work.

bug response required

All 5 comments

@Pegolon The line position referenced in the error is signaling that the issue is caused by line breaks in your cURL command. You'll need to serialize the line breaks to use this command or any other cURL command with multiline JSON values.

@Pegolon Did you get a chance at looking into @patniko's idea about looking for line break escaping in the JSON?

@botatoes Can you take a look at the character limit discrepancy part?

I also noticed that the 5000 character limit stated on the appcenter portal when entering the releae notes is not correct, it only allows 4000 characters. The current character count is also not shown, so it is kind of a guess work.

This issue has been automatically closed because there has been no response to our request for more information within 7 days. If you still need any assistance please reopen the issue or submit a new one.

This is a big issue - Specially for the users who were successfully able to add the release notes with formatting options in HockeyApp.

Hey so you're reporting two issues.

  1. The first one with the character limit of 5000 I wasn't able to reproduce in the UI. I generated a 5000 character long random string, then attempted to save it and I was able to do in both the edit release and the create release flows. Your feedback is well taken around a potential UI indication to show you how many characters are left though. cc @blparr for the portal UX feedback here.

  2. The second one with markdown is interesting. Your actual response is a little mangled by GitHub, but I was able to enter Markdown into the portal without any issues. Can you open a support request for us via the Chat bubble in the website so we can look at the full payload you are sending and see if we can produce a better error message in your scenario?

Was this page helpful?
0 / 5 - 0 ratings