Citoid sends Buffer responses when Zotero is unable to export to bibtex
Open, NormalPublic0 Story Points

Description

For some reason, requests for Bibtex are returned in Buffer format. This is the case for tests, where the Buffer has to be decoded. Curl behaves gracefully and returns plain text, but the browser does not.

Mvolz created this task.Oct 12 2015, 5:41 PM
Mvolz updated the task description. (Show Details)
Mvolz raised the priority of this task from to Needs Triage.
Mvolz added projects: Citoid, Services.
Mvolz moved this task to Service: General and server.js tasks on the Citoid board.
Mvolz added a subscriber: Mvolz.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 12 2015, 5:41 PM
Mvolz updated the task description. (Show Details)Oct 12 2015, 5:44 PM
Mvolz set Security to None.
Mvolz updated the task description. (Show Details)Oct 12 2015, 5:47 PM

Hm, seems to work fine for me:

$ curl -v 'localhost:1970/api?format=bibtex&search=10.1007%2F11926078_68';
> GET /api?format=bibtex&search=10.1007%2F11926078_68 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:1970
> Accept: */*
> 
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: X-Requested-With, Content-Type
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Content-Security-Policy: default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'
< X-Content-Security-Policy: default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'
< X-WebKit-CSP: default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'
< Content-Type: application/x-bibtex; charset=utf-8
< Content-Length: 964
< Date: Mon, 12 Oct 2015 17:50:47 GMT
< Connection: keep-alive
< 

@incollection{krotzsch_semantic_2006,
	series = {Lecture {Notes} in {Computer} {Science}},
	title = {Semantic {MediaWiki}},
	copyright = {©2006 Springer-Verlag Berlin Heidelberg},
	isbn = {978-3-540-49029-6, 978-3-540-49055-5},
	url = {http://link.springer.com/chapter/10.1007/11926078_68},
	language = {en},
	number = {4273},
	urldate = {2015-10-12},
	booktitle = {The {Semantic} {Web} - {ISWC} 2006},
	publisher = {Springer Berlin Heidelberg},
	author = {Krötzsch, Markus and Vrandečić, Denny and Völkel, Max},
	editor = {Cruz, Isabel and Decker, Stefan and Allemang, Dean and Preist, Chris and Schwabe, Daniel and Mika, Peter and Uschold, Mike and Aroyo, Lora M.},
	month = nov,
	year = {2006},
	keywords = {Information Systems Applications (incl.Internet), Information Storage and Retrieval, Computer Communication Networks, Multimedia Information Systems, Logics and Meanings of Programs, Artificial Intelligence (incl. Robotics)},
	pages = {935--942}
}
Mvolz added a comment.Oct 12 2015, 5:53 PM

Yeah, I think it requires a broken zotero that returns a 500 internal server error for every single export request to replicate.

Yeah, I think it requires a broken zotero that returns a 500 internal server error for every single export request to replicate.

So, the question is: how did you brake yours? :P

Mvolz added a comment.Oct 12 2015, 6:04 PM

Who knows?! :)

Out of precaution, I checked the prod servers, it's working there.

So now each of us has a zotero doesn't work for me ticket. This one's yours, and mine is T111734: Citoid test using Zotero results (DOI in URL with query params) failing locally :)

Change 246163 had a related patch set uploaded (by Mvolz):
[WIP] Fix lack of response when export fails

https://gerrit.wikimedia.org/r/246163

Change 246163 merged by Mobrovac:
Fix lack of response when export fails

https://gerrit.wikimedia.org/r/246163

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptJan 8 2016, 6:24 PM

Patch fixes this to return a response but unfortunately in buffer which means that it works ok in curl but not ideal in the browser. Still needs more work.

Restricted Application added a project: VisualEditor. · View Herald TranscriptOct 12 2016, 9:03 PM
Mvolz renamed this task from Citoid sends bad responses when Zotero is unable to export to bibtex to Citoid sends Buffer responses when Zotero is unable to export to bibtex.Oct 28 2016, 4:06 PM
Mvolz updated the task description. (Show Details)
Mvolz triaged this task as Normal priority.
Jdforrester-WMF set the point value for this task to 0.Feb 9 2017, 6:19 PM