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

Restoring backup returns 500 if backup was not called before #463

Closed
philippguertler opened this issue Jul 10, 2018 · 0 comments
Closed
Assignees

Comments

@philippguertler
Copy link
Contributor

philippguertler commented Jul 10, 2018

Gentics Mesh Version, operating system, or hardware.

  • v0.21.3

Problem

See title

Reproducer

Expected behaviour and actual behaviour

I expected a 4xx status code with an appropriate error message.
Instead I got a 500 and this in the Mesh log:

11:41:17.966 [Misty Piplup] ERROR [vert.x-eventloop-thread-4] - Error for request in path: /api/v1/admin/graphdb/restore
11:41:17.966 [Misty Piplup] ERROR [vert.x-eventloop-thread-4] - Error:
java.lang.NullPointerException: null
	at java.util.Objects.requireNonNull(Objects.java:203) ~[na:1.8.0_172]
	at java.util.Arrays$ArrayList.<init>(Arrays.java:3813) ~[na:1.8.0_172]
	at java.util.Arrays.asList(Arrays.java:3800) ~[na:1.8.0_172]
	at com.gentics.mesh.core.endpoint.admin.AdminHandler.lambda$handleRestore$5(AdminHandler.java:93) ~[classes/:na]
	at com.gentics.mesh.graphdb.spi.Database.lambda$null$3(Database.java:121) ~[classes/:na]
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:273) ~[vertx-core-3.5.2.jar:3.5.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_172]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_172]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.19.Final.jar:4.1.19.Final]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_172]
11:41:17.967 [Misty Piplup] ERROR [vert.x-eventloop-thread-4] - 127.0.0.1 - - [Tue, 10 Jul 2018 09:41:17 GMT] "POST /api/v1/admin/graphdb/restore HTTP/1.1" 500 3 "-" "-"

This line is the issue:

File latestFile = Arrays.asList(backupDir.listFiles()).stream().filter(file -> file.getName().endsWith(".zip"))

listFiles() returns null if the directory cannot be found.

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

2 participants