# Trino Hive Connector fails to query data: Could not obtain block

**URL:** <https://www.starburst.io/community/forum/t/trino-hive-connector-fails-to-query-data-could-not-obtain-block/192>\
**Category:** Trino\
**Tags:** hive\
**Created:** [August 18, 2022, 1:04pm UTC](https://www.starburst.io/community/forum/t/trino-hive-connector-fails-to-query-data-could-not-obtain-block/192 "2022-08-18T13:04:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maatouk-j1](https://www.starburst.io/community/forum/user_avatar/www.starburst.io/maatouk-j1/32/94_2.png) [@maatouk-j1](https://www.starburst.io/community/forum/u/maatouk-j1)\
**Post date:** [August 18, 2022, 1:04pm UTC](https://www.starburst.io/community/forum/t/trino-hive-connector-fails-to-query-data-could-not-obtain-block/192/1 "2022-08-18T13:04:19Z")

</div>

Hello,

I’m using the Trino Hive connector to query data in my Kerberized Cloudera CDH 6.x environment.  
I have a Trino master and a Trino worker installed and configured on remote servers (not on same servers as the CDH).  
I configured the “hive.properties” catalog and when I’m using the Trino CLI to test the connection.  
I’m able to fetch metadata when executing commands such as “show schemas from hive” and “show tables from hive.default” but when trying to retrieve data using queries such as “select \* from hive.default.test” I’m getting the following error:

**org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: ….**

I executed the command “hdfs fsck /” from my HDFS node to check if my filesystem is healthy, and indeed it is, there are no missing blocks.

Also, I tried reading the file which the Trino connector is trying to access and it was successful, I can easily check the data using “hdfs dfs -cat ”.

Also, since the HDFS namenode is highly available, I added the configuration resources path (core-site.xml and hdfs-site.xml) to the hive catalog. To note that I downloaded these resources from the node running HDFS on CDH.

I tried researching the error mentioned above but couldn’t resolve it.

Anyone has any idea about this ?

---

<div class="post-metadata">

**Author:** ![zeeshan](https://www.starburst.io/community/forum/letter_avatar_proxy/v4/letter/z/c4cdca/32.png) [@zeeshan](https://www.starburst.io/community/forum/u/zeeshan)\
**Post date:** [November 8, 2022, 4:19am UTC](https://www.starburst.io/community/forum/t/trino-hive-connector-fails-to-query-data-could-not-obtain-block/192/2 "2022-11-08T04:19:29Z")

</div>

this occurs usually HDFS worker nodes are not reachable from Trino .  
check telnet or NC to worker nodes also there is a limitation that all workers nodes must be reachable even if the one worker node is unreachable query will fail .

---

<div class="post-metadata">

**Author:** ![Scorpion2115](https://www.starburst.io/community/forum/user_avatar/www.starburst.io/scorpion2115/32/122_2.png) [@Scorpion2115](https://www.starburst.io/community/forum/u/Scorpion2115)\
**Post date:** [May 20, 2023, 1:15pm UTC](https://www.starburst.io/community/forum/t/trino-hive-connector-fails-to-query-data-could-not-obtain-block/192/3 "2023-05-20T13:15:16Z")

</div>

Hi, I am having exactly the same issue with you. But the odds thing is, my queries from Trino to HDFS do not always failed…Every time after I restart the trino service, the query to HDFS would succeed for couples of times and then started to through out this error

> Caused by: org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block:

So have you resolved this issue yet?

---

<div class="post-metadata">

**Author:** ![LuciferCoder](https://www.starburst.io/community/forum/user_avatar/www.starburst.io/lucifercoder/32/237_2.png) [@LuciferCoder](https://www.starburst.io/community/forum/u/LuciferCoder)\
**Post date:** [May 11, 2024, 8:02am UTC](https://www.starburst.io/community/forum/t/trino-hive-connector-fails-to-query-data-could-not-obtain-block/192/4 "2024-05-11T08:02:54Z")

</div>

you are the hero! I checked my hadoop cluster’s datanode which firewalld service;and stoped the firewalld;  
trino come to right!
