Hydrospheredata / mist

Serverless proxy for Spark cluster
http://hydrosphere.io/mist/
Apache License 2.0
326 stars 68 forks source link

HTTP API - Validate artifact file extension #533

Open gowravshekar opened 5 years ago

gowravshekar commented 5 years ago

Getting the below error if the file mentioned in the path paramter doesn't have any extension.

class akka.pattern.AskTimeoutException: Ask timed out on [Actor[akka://mist/user/$b#-1139334380]] after [5000 ms]. Sender[null] sent message of type "io.hydrosphere.mist.core.CommonData$GetFunctionInfo".

Appending .jar to file and adjusting the same in path works.

dos65 commented 5 years ago

It's required to provide correct file extension because Mist supports .py and .egg files as well as jars. So it's isn't actually a bug, it's a missing validation rule on artifact uploading. It would be nice to respond with correct error explanation.

gowravshekar commented 5 years ago

Instead of forcing the end user for extension; How about appending the extension based on the mime-type of the artifact when the extension is missing.

dos65 commented 5 years ago

Honestly, it's hard to imagine a situation when it would be useful. Usually, these types of files always have a correct file extension. Also, data that describes function has a path field that relies on the file extension too. Changing this thing will break backward compatibility.

Anyway, to upload an artifact you need to explicitly set a filename property and it doesn't have to be the same as in the original file. So you could easily add .jar extension on this step and it will not affect the other part of your workflow.