Forum: Building VoltDB Clients

Post: Error Setting WEBHDFS endpoint for exporting tables

Error Setting WEBHDFS endpoint for exporting tables
interntest
Apr 17, 2015
I have been trying to simulate this example (https://github.com/VoltDB/app-bank-offers). Example works fine with no export or export to CSV files.

However with the instructions given in the example, it does not work well for hadoop export.
With the endpoint property set to

http://localhost:50070/webhdfs/v1.0/user/root/%t/data%p.%g.%t.csv

I get the following error:

ERROR: Export processor failed its configuration check
java.lang.IllegalArgumentException: could not expand endpoint http://localhost:50070/webhdfs/v1.0/%t/data%p.%t.csv

at org.voltdb.exportclient.HttpExportClient.configure(HttpExportClient.java:245)
at org.voltdb.export.processors.GuestProcessor.checkProcessorConfig(GuestProcessor.java:100)
at org.voltdb.utils.CatalogUtil.checkExportProcessorConfiguration(CatalogUtil.java:1079)
at org.voltdb.utils.CatalogUtil.setExportInfo(CatalogUtil.java:1143)
at org.voltdb.utils.CatalogUtil.compileDeployment(CatalogUtil.java:568)
at org.voltdb.Inits$LoadCatalog.run(Inits.java:378)
at org.voltdb.Inits$InitializerWorker.run(Inits.java:108)
at org.voltdb.Inits.doInitializationWork(Inits.java:188)
at org.voltdb.RealVoltDB.initialize(RealVoltDB.java:620)
at org.voltdb.VoltDB.initialize(VoltDB.java:897)
at org.voltdb.VoltDB.main(VoltDB.java:881)
Caused by: java.lang.IllegalArgumentException: hdfs endpoint "http://localhost:50070/webhdfs/v1.0/%t/data%p.%t.csv" must contain the (%t)able, the (%p)artition, and the (%g) generation conversions
at com.google_voltpatches.common.base.Preconditions.checkArgument(Preconditions.java:122)
at org.voltdb.exportclient.decode.EndpointExpander.verifyForHdfsUse(EndpointExpander.java:246)
at org.voltdb.exportclient.HttpExportClient.configure(HttpExportClient.java:239)


So, I appended %g to the file name, and then I get another error

ERROR: Notification request failed with HTTP/1.1 405 HTTP method PUT is not supported by this URL
ERROR: Unable to prime http export client to http://localhost:50070/webhdfs/v1.0/OFFERS_GIVEN_EXP/data4.eo08fdyr1atb.OFFERS_GIVEN_EXP.csv org.voltdb.exportclient.HttpExportClient$PathHandlingException: hdfs makePath returned false for http://localhost:50070/webhdfs/v1.0/OFFERS_GIVEN_EXP/data4.eo08fdyr1atb.OFFERS_GIVEN_EXP.csv
at org.voltdb.exportclient.HttpExportClient$HttpExportDecoder.processRow(HttpExportClient.java:834)
at org.voltdb.export.processors.GuestProcessor$2.run(GuestProcessor.java:221)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.voltcore.utils.CoreUtils$7$1.run(CoreUtils.java:735)
at java.lang.Thread.run(Thread.java:745)


I also tried the following URLs




which returned the same error as Notification request failed with HTTP/1.1 405 HTTP method PUT is not supported by this URL

What might I possibly be doing wrong?
bballard
Apr 17, 2015
Hi interntest,

I just updated the app-bank-offers to provide two example deployment.xml files for the Hortonworks sandbox, and Cloudera quickstart. You were correct to add %g, that was missing from the endpoint and is required.

I think you need to set up a hostname alias in your /etc/hosts file for your hadoop instance. Is it one of these VM-based hadoop instances, or can you describe your Hadoop installation?

The REST interface of WebHDFS involves some redirects. So you may be able to make the initial connection on localhost:50070, but then it redirects you to another page for part of the actions, and that may be on quickstart.cloudera:50070 or sandbox.hortonworks.com:50070, which your host might not recognize.

If you contact me by email at support@voltdb.com, I can send you some word document instructions for integrating with Cloudera or Hortonworks.

Best regards,
Ben
interntest
Apr 20, 2015
Thanks Ben.

Your post was really helpful and the updated deployment.xml files did the trick.
Although I could see my files HDFS explorer (http://127.0.0.1:50070/explorer.html), I continuously get the following error on my terminal

ERROR: Notification request failed with HTTP/1.1 403 Forbidden
ERROR: Unable to complete request to "POST http://hdp.voltdb1.com:50070/webhdfs/v1/user/root/OFFERS_GIVEN_EXP/data0-eojeyg7funzz.OFFERS_GIVEN_EXP.csv?op=APPEND&user.name=root HTTP/1.1". Reason:

org.voltdb.exportclient.ExportDecoderBase$RestartBlockException: requeing on failed response check: FAIL
at org.voltdb.exportclient.HttpExportClient$HttpExportDecoder.onBlockCompletion(HttpExportClient.java:928)
at org.voltdb.export.processors.GuestProcessor$2.run(GuestProcessor.java:223)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.voltcore.utils.CoreUtils$7$1.run(CoreUtils.java:735)
at java.lang.Thread.run(Thread.java:745)

What is wrong here despite my data being exported successfully to HDFS ?
bballard
Apr 21, 2015
This is showing that VoltDB is getting a 403 response code from WebHDFS. Usually a 403 error means the user doesn't have permission to do the action. You might check the permissions to the folder in HDFS.
interntest
Apr 28, 2015
Thanks Ben
I had to change ownership(chown) of the folder in HDFS and the error was gone. :)