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

content/publish fails with FileAsset #16600

Closed
wezell opened this issue May 21, 2019 · 5 comments

Comments

@wezell
Copy link
Contributor

commented May 21, 2019

When you try to upload a file to /content/publish/1 using a multipart form request you get an error 500 and the log shows NullPointerExceptions and "ERROR filters.CookiesFilter - Exception processing Cookies". It happens when authenticate using either basic auth or jwt . Saving non-file content continues working.It is confirmed that this issue not only happens on
installed instances and also when running the vanilla dotcms/dotcms:5.1.5 docker container.

@jgambarios jgambarios added this to the Cody Current milestone May 21, 2019

fabrizzio-dotCMS added a commit that referenced this issue May 23, 2019

fabrizzio-dotCMS added a commit that referenced this issue May 23, 2019

@fabrizzio-dotCMS

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

The issue was caused by a collateral effect of a fixed previously applied for #15934

The new code lives in a branch called issue-16600-fileAsset-push-fails

I have tested it and it works using the following CURL examples.

curl -v -u admin@dotcms.com:admin -X POST \ http://localhost:8080/api/content/publish/1 \ -H 'cache-control: no-cache' \ -F 'json={ contentType:'\''fileAsset'\'', hostFolder:'\''demo.dotcms.com'\'', title:'\''lol'\'', fileName:'\''lol2'\'' };type=application/json' \ -F 'file=@index.txt; type=application/plain'

curl -v -u admin@dotcms.com:admin -X POST \ http://localhost:8080/api/content/publish/1 \ -H 'cache-control: no-cache' \ -F 'json={ contentType:'\''fileAsset'\'', hostFolder:'\''demo.dotcms.com'\'', title:'\''lol'\'', fileName:'\''lol3'\'' };type=application/json' \ -F 'file=@index.txt; type=text/plain'

curl -v -u admin@dotcms.com:admin \ -XPUT http://localhost:8080/api/content/publish/1 \ -F "json={ \ contentType:'fileAsset', \ hostFolder:'demo.dotcms.com:/images', \ title:'nice.jpg', \ fileName:'nice.jpg'}; \ type=application/json" \ -F "file=@liz.jpg; \ type=application/jpg"

@fabrizzio-dotCMS

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

Additionally, to that, I also used the example from our documentation that appears here
https://dotcms.com/docs/latest/content-api-posting-files

@jgambarios

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

PR: #16619

jgambarios added a commit that referenced this issue May 24, 2019

Issue 16600 file asset push fails (#16619)
* #16600 reintroducing code that was removed for #15934

* #16600 file upload supoort using text/plain header
@jgambarios

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

Note to QA: We also need as part of this ticket to re-test #15934

@bryanboza

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

Fixed, tested on master // Postgres // FF also retested the #15934

@bryanboza bryanboza added Passed QA and removed Needs QA labels May 29, 2019

@bryanboza bryanboza moved this from CODY to Done in QA May 29, 2019

jgambarios added a commit that referenced this issue May 30, 2019

Issue 16600 file asset push fails (#16619)
* #16600 reintroducing code that was removed for #15934

* #16600 file upload supoort using text/plain header

(cherry picked from commit afebde6)

@jgambarios jgambarios removed this from Done in QA May 30, 2019

@bryanboza bryanboza added this to CODY in QA May 30, 2019

@bryanboza bryanboza moved this from CODY to Done in QA May 30, 2019

@wezell wezell closed this Jun 3, 2019

@bryanboza bryanboza added this to Done in Release 5.1.6 Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.