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

CommandException: Invalid command "application/json". #34

Closed
rviscomi opened this issue Mar 28, 2018 · 3 comments
Closed

CommandException: Invalid command "application/json". #34

rviscomi opened this issue Mar 28, 2018 · 3 comments
Assignees
Labels

Comments

@rviscomi
Copy link
Member

During generateReports.sh at the end of each metric being generated, I noticed the following error:

CommandException: Invalid command "application/json".

Ensure that the JSON files are being uploaded to GCS correctly.

@rviscomi rviscomi added the bug label Mar 28, 2018
@rviscomi rviscomi self-assigned this Mar 28, 2018
@rviscomi
Copy link
Member Author

rviscomi commented Mar 28, 2018

Here's the code in the context of the error:

# Run the query on BigQuery.
result=$(cat $query \
	| $BQ_CMD)
# Make sure the query succeeded.
if [ $? -eq 0 ]; then
	# Upload the response to Google Storage.
	echo $result \
		| gsutil  -h "Content-Type: application/json" cp - $gs_url
else	
	echo $result >&2
fi	

Maybe a newer version of gsutil doesn't like the -h flag?

@rviscomi
Copy link
Member Author

Found the problem. It doesn't like the space after Content-Type:. Not sure how this ever worked 😕

@igrigorik
Copy link
Collaborator

It doesn't like the space after Content-Type:

That's silly. Looks like they "fixed" (broke) this in some recent release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants