Unable to discover tx service error

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to discover tx service error

ashish tapdiya
Hi,

I am trying to create transactional tables and during table creation following error is thrown (phoenix version is 4.8.1):


java.lang.RuntimeException: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:268)
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.util.TransactionUtil.getTableTimestamp(TransactionUtil.java:99)
        at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1891)
        at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:940)
        at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:193)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:344)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeUpdate(PhoenixPreparedStatement.java:199)
        at Populate_Transact.createTables(Populate_Transact.java:75)
        at Populate_Transact.main(Populate_Transact.java:30)
Caused by: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:227)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:185)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:259)
        ... 13 more
Caused by: org.apache.phoenix.shaded.org.apache.thrift.TException: Unable to discover tx service.
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:106)
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:85)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:48)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:41)
        at org.apache.tephra.distributed.ElasticPool.getOrCreate(ElasticPool.java:138)
        at org.apache.tephra.distributed.ElasticPool.obtain(ElasticPool.java:125)
        at org.apache.tephra.distributed.PooledClientProvider.getCloseableClient(PooledClientProvider.java:101)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:214)

Thanks,
Ashish
Reply | Threaded
Open this post in threaded view
|

Re: Unable to discover tx service error

Poorna Chandra
Hi Ashish,

Looks like transaction manager may not be running. Is the transaction manager running? If so, can you look into the transaction manager log to see if there are any errors?

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 10:20 AM, ashish tapdiya <[hidden email]> wrote:
Hi,

I am trying to create transactional tables and during table creation following error is thrown (phoenix version is 4.8.1):


java.lang.RuntimeException: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:268)
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.util.TransactionUtil.getTableTimestamp(TransactionUtil.java:99)
        at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1891)
        at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:940)
        at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:193)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:344)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeUpdate(PhoenixPreparedStatement.java:199)
        at Populate_Transact.createTables(Populate_Transact.java:75)
        at Populate_Transact.main(Populate_Transact.java:30)
Caused by: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:227)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:185)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:259)
        ... 13 more
Caused by: org.apache.phoenix.shaded.org.apache.thrift.TException: Unable to discover tx service.
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:106)
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:85)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:48)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:41)
        at org.apache.tephra.distributed.ElasticPool.getOrCreate(ElasticPool.java:138)
        at org.apache.tephra.distributed.ElasticPool.obtain(ElasticPool.java:125)
        at org.apache.tephra.distributed.PooledClientProvider.getCloseableClient(PooledClientProvider.java:101)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:214)

Thanks,
Ashish

Reply | Threaded
Open this post in threaded view
|

Re: Unable to discover tx service error

ashish tapdiya
Hi Poorna,

jps showed that process was running however logs had error related to tx.data.dir not setup correctly. I added data.tx.snapshot.dir to client as well and then logs didn't show any error and I was able to create schema.

However, now when I try to populate a table created with transactional=true, it fails

1) Error thorugh mapreduce bulk loader:
Error: java.lang.RuntimeException: java.lang.NullPointerException
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:202)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:74)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1692)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.NullPointerException
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:339)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:250)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:172)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:177)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:86)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:46)
        at org.apache.phoenix.util.UpsertExecutor.execute(UpsertExecutor.java:133)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:171)


2) Error through psql.py
ERROR util.CSVCommonsLoader: Error upserting record

Thanks,
Ashish

On Thu, Nov 3, 2016 at 8:25 PM, Poorna Chandra <[hidden email]> wrote:
Hi Ashish,

Looks like transaction manager may not be running. Is the transaction manager running? If so, can you look into the transaction manager log to see if there are any errors?

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 10:20 AM, ashish tapdiya <[hidden email]> wrote:
Hi,

I am trying to create transactional tables and during table creation following error is thrown (phoenix version is 4.8.1):


java.lang.RuntimeException: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:268)
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.util.TransactionUtil.getTableTimestamp(TransactionUtil.java:99)
        at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1891)
        at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:940)
        at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:193)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:344)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeUpdate(PhoenixPreparedStatement.java:199)
        at Populate_Transact.createTables(Populate_Transact.java:75)
        at Populate_Transact.main(Populate_Transact.java:30)
Caused by: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:227)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:185)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:259)
        ... 13 more
Caused by: org.apache.phoenix.shaded.org.apache.thrift.TException: Unable to discover tx service.
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:106)
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:85)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:48)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:41)
        at org.apache.tephra.distributed.ElasticPool.getOrCreate(ElasticPool.java:138)
        at org.apache.tephra.distributed.ElasticPool.obtain(ElasticPool.java:125)
        at org.apache.tephra.distributed.PooledClientProvider.getCloseableClient(PooledClientProvider.java:101)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:214)

Thanks,
Ashish


Reply | Threaded
Open this post in threaded view
|

Re: Unable to discover tx service error

Poorna Chandra-2
Hi Ashish,

Is phoenix.transactions.enabled property set in hbase-site.xml on the client side? Not setting that could be one of the reasons for the NPE.

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 7:02 PM, ashish tapdiya <[hidden email]> wrote:
Hi Poorna,

jps showed that process was running however logs had error related to tx.data.dir not setup correctly. I added data.tx.snapshot.dir to client as well and then logs didn't show any error and I was able to create schema.

However, now when I try to populate a table created with transactional=true, it fails

1) Error thorugh mapreduce bulk loader:
Error: java.lang.RuntimeException: java.lang.NullPointerException
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:202)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:74)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1692)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.NullPointerException
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:339)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:250)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:172)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:177)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:86)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:46)
        at org.apache.phoenix.util.UpsertExecutor.execute(UpsertExecutor.java:133)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:171)


2) Error through psql.py
ERROR util.CSVCommonsLoader: Error upserting record

Thanks,
Ashish

On Thu, Nov 3, 2016 at 8:25 PM, Poorna Chandra <[hidden email]> wrote:
Hi Ashish,

Looks like transaction manager may not be running. Is the transaction manager running? If so, can you look into the transaction manager log to see if there are any errors?

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 10:20 AM, ashish tapdiya <[hidden email]> wrote:
Hi,

I am trying to create transactional tables and during table creation following error is thrown (phoenix version is 4.8.1):


java.lang.RuntimeException: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:268)
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.util.TransactionUtil.getTableTimestamp(TransactionUtil.java:99)
        at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1891)
        at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:940)
        at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:193)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:344)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeUpdate(PhoenixPreparedStatement.java:199)
        at Populate_Transact.createTables(Populate_Transact.java:75)
        at Populate_Transact.main(Populate_Transact.java:30)
Caused by: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:227)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:185)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:259)
        ... 13 more
Caused by: org.apache.phoenix.shaded.org.apache.thrift.TException: Unable to discover tx service.
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:106)
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:85)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:48)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:41)
        at org.apache.tephra.distributed.ElasticPool.getOrCreate(ElasticPool.java:138)
        at org.apache.tephra.distributed.ElasticPool.obtain(ElasticPool.java:125)
        at org.apache.tephra.distributed.PooledClientProvider.getCloseableClient(PooledClientProvider.java:101)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:214)

Thanks,
Ashish



Reply | Threaded
Open this post in threaded view
|

Re: Unable to discover tx service error

James Taylor
Ashish,
Did you see these directions here: https://phoenix.apache.org/transactions.html?
Thanks,
James

On Fri, Nov 4, 2016 at 4:01 PM, Poorna Chandra <[hidden email]> wrote:
Hi Ashish,

Is phoenix.transactions.enabled property set in hbase-site.xml on the client side? Not setting that could be one of the reasons for the NPE.

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 7:02 PM, ashish tapdiya <[hidden email]> wrote:
Hi Poorna,

jps showed that process was running however logs had error related to tx.data.dir not setup correctly. I added data.tx.snapshot.dir to client as well and then logs didn't show any error and I was able to create schema.

However, now when I try to populate a table created with transactional=true, it fails

1) Error thorugh mapreduce bulk loader:
Error: java.lang.RuntimeException: java.lang.NullPointerException
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:202)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:74)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1692)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.NullPointerException
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:339)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:250)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:172)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:177)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:86)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:46)
        at org.apache.phoenix.util.UpsertExecutor.execute(UpsertExecutor.java:133)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:171)


2) Error through psql.py
ERROR util.CSVCommonsLoader: Error upserting record

Thanks,
Ashish

On Thu, Nov 3, 2016 at 8:25 PM, Poorna Chandra <[hidden email]> wrote:
Hi Ashish,

Looks like transaction manager may not be running. Is the transaction manager running? If so, can you look into the transaction manager log to see if there are any errors?

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 10:20 AM, ashish tapdiya <[hidden email]> wrote:
Hi,

I am trying to create transactional tables and during table creation following error is thrown (phoenix version is 4.8.1):


java.lang.RuntimeException: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:268)
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.util.TransactionUtil.getTableTimestamp(TransactionUtil.java:99)
        at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1891)
        at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:940)
        at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:193)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:344)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeUpdate(PhoenixPreparedStatement.java:199)
        at Populate_Transact.createTables(Populate_Transact.java:75)
        at Populate_Transact.main(Populate_Transact.java:30)
Caused by: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:227)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:185)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:259)
        ... 13 more
Caused by: org.apache.phoenix.shaded.org.apache.thrift.TException: Unable to discover tx service.
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:106)
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:85)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:48)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:41)
        at org.apache.tephra.distributed.ElasticPool.getOrCreate(ElasticPool.java:138)
        at org.apache.tephra.distributed.ElasticPool.obtain(ElasticPool.java:125)
        at org.apache.tephra.distributed.PooledClientProvider.getCloseableClient(PooledClientProvider.java:101)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:214)

Thanks,
Ashish




Reply | Threaded
Open this post in threaded view
|

Re: Unable to discover tx service error

ashish tapdiya
Thanks for the reply folks.

I did the configuration as described in the Transactions page of our website; however, I figured the issue was related to me running HBase master, Tephra server and Phoenix client on the same machine and incorrect configurations.

Tephra server was using the hbase-site.xml on the classpath configured for the Phoenix client which just had phoenix.transactions.enabled set to true but data.tx.snapshot.dir was missing hence Tephra server was failing. On the other hand, psql.py and mapreduce based loaders were using the hbase-site.xml present in the hbase/conf directory which had data.tx.snapshot.dir set but phoenix.transactions.enabled was not set to true (default false was used) hence population of tables created with transactional = true was failing.

After having both configurations (client + server) in each hbase-site.xml files everything works fine.

Thanks,
Ashish


On Fri, Nov 4, 2016 at 6:39 PM, James Taylor <[hidden email]> wrote:
Ashish,
Did you see these directions here: https://phoenix.apache.org/transactions.html?
Thanks,
James

On Fri, Nov 4, 2016 at 4:01 PM, Poorna Chandra <[hidden email]> wrote:
Hi Ashish,

Is phoenix.transactions.enabled property set in hbase-site.xml on the client side? Not setting that could be one of the reasons for the NPE.

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 7:02 PM, ashish tapdiya <[hidden email]> wrote:
Hi Poorna,

jps showed that process was running however logs had error related to tx.data.dir not setup correctly. I added data.tx.snapshot.dir to client as well and then logs didn't show any error and I was able to create schema.

However, now when I try to populate a table created with transactional=true, it fails

1) Error thorugh mapreduce bulk loader:
Error: java.lang.RuntimeException: java.lang.NullPointerException
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:202)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:74)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1692)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.NullPointerException
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:339)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:250)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:172)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:177)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:86)
        at org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:46)
        at org.apache.phoenix.util.UpsertExecutor.execute(UpsertExecutor.java:133)
        at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.map(FormatToBytesWritableMapper.java:171)


2) Error through psql.py
ERROR util.CSVCommonsLoader: Error upserting record

Thanks,
Ashish

On Thu, Nov 3, 2016 at 8:25 PM, Poorna Chandra <[hidden email]> wrote:
Hi Ashish,

Looks like transaction manager may not be running. Is the transaction manager running? If so, can you look into the transaction manager log to see if there are any errors?

Thanks,
Poorna.


On Thu, Nov 3, 2016 at 10:20 AM, ashish tapdiya <[hidden email]> wrote:
Hi,

I am trying to create transactional tables and during table creation following error is thrown (phoenix version is 4.8.1):


java.lang.RuntimeException: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:268)
        at org.apache.tephra.TransactionContext.start(TransactionContext.java:91)
        at org.apache.phoenix.execute.MutationState.startTransaction(MutationState.java:422)
        at org.apache.phoenix.util.TransactionUtil.getTableTimestamp(TransactionUtil.java:99)
        at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1891)
        at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:940)
        at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:193)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:344)
        at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:332)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:331)
        at org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeUpdate(PhoenixPreparedStatement.java:199)
        at Populate_Transact.createTables(Populate_Transact.java:75)
        at Populate_Transact.main(Populate_Transact.java:30)
Caused by: java.lang.Exception: Thrift error for org.apache.tephra.distributed.TransactionServiceClient$2@6ea02a8d: Unable to discover tx service.
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:227)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:185)
        at org.apache.tephra.distributed.TransactionServiceClient.startShort(TransactionServiceClient.java:259)
        ... 13 more
Caused by: org.apache.phoenix.shaded.org.apache.thrift.TException: Unable to discover tx service.
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:106)
        at org.apache.tephra.distributed.AbstractClientProvider.newClient(AbstractClientProvider.java:85)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:48)
        at org.apache.tephra.distributed.PooledClientProvider$TxClientPool.create(PooledClientProvider.java:41)
        at org.apache.tephra.distributed.ElasticPool.getOrCreate(ElasticPool.java:138)
        at org.apache.tephra.distributed.ElasticPool.obtain(ElasticPool.java:125)
        at org.apache.tephra.distributed.PooledClientProvider.getCloseableClient(PooledClientProvider.java:101)
        at org.apache.tephra.distributed.TransactionServiceClient.execute(TransactionServiceClient.java:214)

Thanks,
Ashish