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

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

Open
carrollgt91 opened this issue May 21, 2015 · 6 comments

Comments

@carrollgt91
Copy link

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:

  • Use this Dockerfile to build the image
  • docker build -t drake-bug
  • docker run --name drake-bug -t drake-bug .
  • docker exec -it drake-bug bash
  • build the drake uberjar
  • cd into the demo directory in the drake repo
  • run java -jar ../../drake.jar
@amalloy
Copy link
Contributor

amalloy commented May 21, 2015

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
Copy link
Author

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
Copy link
Contributor

amalloy commented May 21, 2015

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
Copy link
Author

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
Copy link
Author

Here are the steps to best test it:

  • cd into the drake repository on your computer
  • docker run -i -v pwd:/home/drake -t clojure /bin/bash

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
Copy link

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:

["shell" (get (System/getenv) "SHELL") nil])

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

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

No branches or pull requests

3 participants