locationtech / geogig

GeoGig project
Other
403 stars 80 forks source link

NullPointerException while cloning if wrong URI spec was given #439

Open mclucky opened 6 years ago

mclucky commented 6 years ago

This is the error log, after I provided a wrong URI.

Cloning into 'swwat_gfl'... 22:45:00.676 [main] ERROR o.locationtech.geogig.cli.GeogigCLI - An unhandled error occurred: null. See the log for more details. java.lang.NullPointerException: null at org.locationtech.geogig.storage.postgresql.PGRepositoryResolver.open(PGRepositoryResolver.java:126) ~[geogig-postgres-1.2.0.jar:1.2.0] at org.locationtech.geogig.repository.RepositoryResolver.load(RepositoryResolver.java:207) ~[geogig-api-1.2.0.jar:1.2.0] at org.locationtech.geogig.remotes.internal.LocalRemoteRepo.open(LocalRemoteRepo.java:99) ~[geogig-remoting-1.2.0.jar:1.2.0] at org.locationtech.geogig.remotes.OpenRemote._call(OpenRemote.java:57) ~[geogig-remoting-1.2.0.jar:1.2.0] at org.locationtech.geogig.remotes.OpenRemote._call(OpenRemote.java:29) ~[geogig-remoting-1.2.0.jar:1.2.0] at org.locationtech.geogig.repository.AbstractGeoGigOp.call(AbstractGeoGigOp.java:154) ~[geogig-api-1.2.0.jar:1.2.0] at org.locationtech.geogig.remotes.CloneOp.openRemote(CloneOp.java:357) ~[geogig-remoting-1.2.0.jar:1.2.0] at org.locationtech.geogig.remotes.CloneOp._call(CloneOp.java:105) ~[geogig-remoting-1.2.0.jar:1.2.0] at org.locationtech.geogig.remotes.CloneOp._call(CloneOp.java:73) ~[geogig-remoting-1.2.0.jar:1.2.0] at org.locationtech.geogig.repository.AbstractGeoGigOp.call(AbstractGeoGigOp.java:154) ~[geogig-api-1.2.0.jar:1.2.0] at org.locationtech.geogig.cli.porcelain.Clone.runInternal(Clone.java:166) ~[geogig-cli-1.2.0.jar:1.2.0] at org.locationtech.geogig.cli.AbstractCommand.run(AbstractCommand.java:68) ~[geogig-cli-1.2.0.jar:1.2.0] at org.locationtech.geogig.cli.GeogigCLI.executeInternal(GeogigCLI.java:532) ~[geogig-cli-1.2.0.jar:1.2.0] at org.locationtech.geogig.cli.GeogigCLI.execute(GeogigCLI.java:368) ~[geogig-cli-1.2.0.jar:1.2.0] at org.locationtech.geogig.cli.app.CLI.run(CLI.java:95) [geogig-cli-app-1.2.0.jar:1.2.0] at org.locationtech.geogig.cli.app.CLI.main(CLI.java:113) [geogig-cli-app-1.2.0.jar:1.2.0] An unhandled error occurred: null. See the log for more details.

mclucky commented 6 years ago

Does anyone have input to this issue?

emerkle826 commented 6 years ago

@mclucky We'll keep this issue open and try to handle the Exception a bit better and give a more meaningful error message. Could you provide an example of the URI that generated this trace?

mclucky commented 6 years ago

@emerkle826 for example, when using postgis as your storage backend and you'll provide a wrong <reponame> in the URI then you'll get an unhandled exception.

I refer to this URI specification from your docs: postgresql://<server>[:<port>]/<database>[/<schema>]/<reponame>?user=<username>&password=<pwd>

emerkle826 commented 6 years ago

The PostgreSQL URI specification is here in the docs: http://geogig.org/docs/repo/storage.html#postgresql-storage-backend

The example you provided doesn't technically fit the spec, but the error should be more indicative of that. Thanks for the issue, we'll keep it open to try to address the error message.

mclucky commented 6 years ago

sorry @emerkle826 my last post was displayed invalid because github malformed the repo spec. I've updated that post and put the related words under source markdown.

emerkle826 commented 6 years ago

Thanks for the update. I'll take a look and see if I can have it give a better message.