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

Error executing command: java.lang.NullPointerException #133

Closed
dhermanns opened this issue Dec 19, 2017 · 9 comments
Closed

Error executing command: java.lang.NullPointerException #133

dhermanns opened this issue Dec 19, 2017 · 9 comments

Comments

@dhermanns
Copy link

dhermanns commented Dec 19, 2017

Hi!

I just tried the new version 2.2.0. Both the alpine and the debian version running on my raspberry pi3.
V2.1.0 works fine, but with the new version, I got with both images:

openhab2_1  | Hit '<tab>' for a list of available commands
openhab2_1  | and '[cmd] --help' for help on a specific command.
openhab2_1  | Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.
openhab2_1  | 
openhab2_1  | openhab> Error executing command: java.lang.NullPointerException

The openhab.log says:

2017-12-19 22:16:18.448 [WARN ] [org.jline                           ] - Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
2017-12-19 22:16:21.555 [ERROR] [ternal.service.BootFeaturesInstaller] - Error installing boot features
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@75355f rejected from java.util.concurrent.ThreadPoolExecutor@1613219[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369) [?:?]
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [?:?]
	at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:681) [?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvisionInThread(FeaturesServiceImpl.java:1146) [9:org.apache.karaf.features.core:4.1.3]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:1022) [9:org.apache.karaf.features.core:4.1.3]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:915) [9:org.apache.karaf.features.core:4.1.3]
	at org.apache.karaf.features.internal.service.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:107) [9:org.apache.karaf.features.core:4.1.3]
	at org.apache.karaf.features.internal.service.BootFeaturesInstaller.start(BootFeaturesInstaller.java:87) [9:org.apache.karaf.features.core:4.1.3]
	at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:273) [9:org.apache.karaf.features.core:4.1.3]
	at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:242) [9:org.apache.karaf.features.core:4.1.3]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

My docker version is 1.11.1. Docker-compose is 1.9.0.
Does someone else experience the same problems?

@wborn
Copy link
Member

wborn commented Dec 20, 2017

Did you also apply the instructions from the release notes @dhermanns?

Running openhab using docker
There are small changes for running openHAB using docker. For both docker and docker-compose you have to pass a parameter to inform docker that it should 'allocate a pseudo-TTY'. The examples have been updated but the short explanation is that docker run needs either the -t or --tty parameter and docker-compose needs configuration format 2.1 and tty: true.

@dhermanns
Copy link
Author

dhermanns commented Dec 20, 2017 via email

@wborn
Copy link
Member

wborn commented Dec 20, 2017

That's OK. Just tell us if it fixes your issue @dhermanns so it can be closed.

If you also use stdin_open: true with the tty: true or (-ti) you can also use docker attach to get straight into the container without having to connect to Karaf via the ssh client.

E.g. when your container is named 'openhab' use:
docker attach openhab

Then you can issue console commands like log:tail etc. Maybe we should also add that to the readme? 🙂

@cniweb
Copy link
Member

cniweb commented Dec 20, 2017

It's already mentioned in the readme, see:
https://github.com/openhab/openhab-docker/blob/master/README.md#usage
docker run -it --name openhab --net=host openhab/openhab:2.2.0-amd64-debian

@cniweb
Copy link
Member

cniweb commented Dec 20, 2017

How and at which point should this be mentioned in the readme?

@wborn
Copy link
Member

wborn commented Dec 20, 2017

@cniweb I meant adding docker attach containername to the docs as an alternate method for accessing the console. You won't have to enter the password this way.

Do you mean that as well or did you mean that the containers now need to be started with -t? I've seen such changes also listed in container documentation but people who are eager to test a new version will probably not read it. ;-)

What I had in mind was adding some text about docker attach to the following section:


Accessing the console

You can connect to a console of an already running openHAB container with following command:

  • docker ps - lists all your currently running container
  • docker exec -it openhab /openhab/runtime/bin/client - connect to openHAB container by name
  • docker exec -it c4ad98f24423 /openhab/runtime/bin/client - connect to openHAB container by id
  • docker attach openhab - attach to openHAB container by name, input only works when starting the container with -i (or stdin_open: true with docker compose)

The default password for login via the client is habopen.


@dhermanns
Copy link
Author

Even with tty: true, I now run into another problem, which is probably related to docker:

docker-compose up
Starting openhab2_openhab2_1
Attaching to openhab2_openhab2_1
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/code/compose/cli/main.py", line 65, in main
  File "/code/compose/cli/main.py", line 117, in perform_command
  File "/code/compose/cli/main.py", line 862, in up
  File "/code/compose/cli/log_printer.py", line 87, in run
  File "/code/compose/cli/log_printer.py", line 229, in consume_queue
MemoryError

The workaround is to start as daemon:
docker-compose up -d

Maybe this is helpful to someone else...

@wborn
Copy link
Member

wborn commented Dec 20, 2017

Upgrading docker-compose probably fixes that @dhermanns , see: docker/compose#4758

@dhermanns
Copy link
Author

Yes - I will try this.

cniweb added a commit that referenced this issue Dec 20, 2017
* Add docker attach
Fix #133

Signed-off-by: Christian Häussler <c-n-i@web.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants