Factual / drake

Data workflow tool, like a "Make for data"
Other
1.48k stars 112 forks source link

Ljava.lang.Object cannot be cast to Ljava.lang.String when running demo workflows in Ubuntu #171

Open carrollgt91 opened 9 years ago

carrollgt91 commented 9 years ago

I'm receiving the following error when trying to run pretty much any drake workflow, including the workflows included with the source:

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
    at drake.shell$shell.doInvoke(shell.clj:96)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:624)
    at drake.protocol$run_interpreter.invoke(protocol.clj:86)
    at drake.protocol_interpreters$register_interpreter_BANG_$reify__2193.run(protocol_interpreters.clj:13)
    at drake.core$run_step.invoke(core.clj:359)
    at drake.core$attempt_run_step.invoke(core.clj:471)
    at drake.core$function_for_step$fn__5382.invoke(core.clj:494)
    at drake.core$trigger_futures_helper$fn__5393.invoke(core.clj:532)
    at clojure.core$binding_conveyor_fn$fn__4145.invoke(core.clj:1910)
    at clojure.lang.AFn.call(AFn.java:18)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:701)

I'm running this within Docker using open-jdk-6 (or 7, the same error crops up) and the latest version of leiningen. Easiest way to reproduce:

amalloy commented 9 years ago

What is a specific drakefile that you have problems with? The demo directory itself does not have a runnable drakefile. I tried reproducing locally on some of the demo drakefiles, and it works fine. As for your Docker container, I don't know a lot about docker but after installing it and downloading your dockerfile, the commands you recommend do not succeed in making anything happen:

$ docker build -t drake-bug .
Sending build context to Docker daemon
FATA[0000] Post http:///var/run/docker.sock/v1.18/build?cpusetcpus=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=drake-bug: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
carrollgt91 commented 9 years ago

Ah my bad, I was running the peopleskills workflow. I've also tried some simple drakefiles (the one in the tutorial comes to mind using grep i $INPUT > $OUTPUT and the same bug is occurring.

As for why your Docker is failing, if you're running on OSX you have to use boot2docker. You might try boot2docker start and then run the docker commands again.

Thanks!

amalloy commented 9 years ago

Does this docker instance really have no text editor at all? How am I supposed to debug this? I can't run emacs, vim, nano, anything. And I apparently can't apt-get any of them either.

carrollgt91 commented 9 years ago

I'll set up a better debug environment where the repo is attached as a volume instead so that you can edit the code on your local machine and run it inside the container.

carrollgt91 commented 9 years ago

Here are the steps to best test it:

Now, you can edit the code on your local machine, and use the bash shell running in the container to execute the code. The repository will be located in the /home/drake directory in the container, and is effectively symlinked to the directory on your own computer.

You could probably even get an nrepl server up and running by specifiying a port using the -p flag when you run the container See this for more details.

Let me know if you need any more information. I haven't had time to boot this up on my clojure environment, but I'll dig in over the weekend to see if I can't help in getting to the bottom of it.

yoshimotob commented 9 years ago

I ran into the same issue on docker. I have a workaround, which is to add the SHELL env variable before launching a drake workflow:

export SHELL="/bin/bash"

The issue is that when SHELL is null it affects drake: https://github.com/Factual/drake/blob/b71c1d11b2bc473615606586a6f9eb1b1d19b082/src/drake/protocol_interpreters.clj#L17

When running a step, this causes an incorrect split: https://github.com/Factual/drake/blob/develop/src/drake/shell.clj#L85

Which passes in an empty array as an arg (typed as Object[]), leading to the ClassCastException: https://github.com/Factual/drake/blob/develop/src/drake/shell.clj#L97