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

Query parameters not passed to form resources #1041

Closed
MartijnR opened this issue Oct 26, 2021 · 7 comments
Closed

Query parameters not passed to form resources #1041

MartijnR opened this issue Oct 26, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@MartijnR
Copy link
Member

MartijnR commented Oct 26, 2021

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%5B%40version%3D1+and+%40uiVersion%3D0%5D%2F_form_info%5B%40key%3Dmd5%3Acc0a52104c3e1028d7b23cca46837e72%5D%2F_form_info_fileset%5B%40ordinal%3D1%5D%2FmanifestFileset%5B%40ordinal%3D1%5D&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

@MartijnR MartijnR added the bug Something isn't working label Oct 26, 2021
@MartijnR MartijnR changed the title Form resources fail to download (from ODK Aggregate) Form resources fail to download (from e.g. ODK Aggregate) Oct 26, 2021
@eyelidlessness
Copy link
Collaborator

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

@MartijnR
Copy link
Member Author

Oh that's great. Thanks!

@yanokwa
Copy link
Member

yanokwa commented Oct 27, 2021

@eyelidlessness Is this just an issue with Aggregate or does it affect Central? And if it does, what types of forms does it affect? I guess what I'm asking is that should we plan a hot fix for Central?

@eyelidlessness
Copy link
Collaborator

@yanokwa It affects anything that uses query parameters in media mappings. I haven't seen that in Central but I don't know whether that's possible.

@yanokwa
Copy link
Member

yanokwa commented Oct 27, 2021

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

@MartijnR
Copy link
Member Author

Not urgent! Thanks for checking.

@lognaturel lognaturel changed the title Form resources fail to download (from e.g. ODK Aggregate) Query parameters not passed to form resources Oct 30, 2021
@yanokwa
Copy link
Member

yanokwa commented Nov 4, 2021

Fixed by enketo/enketo-transformer#132

@yanokwa yanokwa closed this as completed Nov 4, 2021
@lognaturel lognaturel transferred this issue from enketo/enketo-express Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants