question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Query parameters not passed to form resources

See original GitHub issue

Describe the bug It looks like any form with media hosted on Aggregate is failing to load those media files. For a form with images this fails silently. For a form with external data this fails with an “Unable to auto-detect delimiting character; defaulted to ‘,’” error.

To Reproduce

  1. get URL to aggregate-hosted survey: curl --user enketorules: -d "server_url=https://enketo-aggregate.appspot.com&form_id=widgets_on_pages" http://localhost:8005/api/v2/survey/
  2. load the URL
  3. inspect failed media download(s) in network tab, see something like:
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>400 Insuffiecent Parameters Received</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Insuffiecent Parameters Received</h1>
</body></html>

Expected behavior Form to load with media resources.

Additional context Link to media manifest on Aggregate for this form: https://enketo-aggregate.appspot.com/xformsManifest?formId=widgets_on_pages

I looks like a link to a download url such as https://enketo-aggregate.appspot.com/xformsDownload?blobKey=aggregate.opendatakit.org%3AFormInfo[%40version%3D1+and+%40uiVersion%3D0]%2F_form_info[%40key%3Dmd5%3Acc0a52104c3e1028d7b23cca46837e72]%2F_form_info_fileset[%40ordinal%3D1]%2FmanifestFileset[%40ordinal%3D1]&as_attachment=true no longer survives into the transformation result.

I believe the whole query part of the download URL is stripped out.

A simpler form without external data: curl --user enketorules: -d "server_url=https://enketo-aggregate.appspot.com&form_id=big-image" http://localhost:8005/api/v2/survey

The regression occurred in 3.0.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yanokwacommented, Oct 27, 2021

@lognaturel Says it’s not an issue for Central (whew!). @MartijnR how urgently do you need this released?

1reaction
eyelidlessnesscommented, Oct 26, 2021

Thanks for filing this @MartijnR. I believe I’ve found the cause: in https://github.com/enketo/enketo-transformer/pull/111, when provided an absolute/relative URL, only the path is returned. This is obviously incorrect, thankfully it should be a trivial fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the problem with required query parameters?
When reviewing API designs, I often encounter operations such as GET /resources?queryParameter=value where the query parameter is required.
Read more >
HTTP POST with URL query parameters -- good idea or not?
Here's one: A web form can't be used to send a request to a page that uses a mix of GET and POST....
Read more >
REST API Design Best Practices for Parameter and Query ...
Best practices for parameter and query string usage in REST APIs. ... While HTTP verbs and resource URLs allow for some basic interaction, ......
Read more >
Use query parameters to customize responses - Microsoft Graph
Microsoft Graph provides optional query parameters that you can use to specify and control the amount of data returned in a response.
Read more >
$resource - How do I pass query parameters with PUT method
When I am using the PUT method the above data passed to the User add function is being passed as JSON data rather...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found