# Failure during setup error when from REST Application

**URL:** https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328
**Category:** Uncategorized
**Created:** [September 23, 2024, 10:46am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328 "2024-09-23T10:46:22Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [September 23, 2024, 10:46am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/1 "2024-09-23T10:46:22Z")

</div>

Hello, we are getting `Failure during setup` when running query through REST Application. `INVALID_DATASET_METADATA ERROR` in profile.  
Running same query friom UI works fine and afterwards REST Application runnin same query is also green in logs.  
Changing WHERE clause(id in (different value)) in query makes REST app fail again.  
Running `REFRESH METADATA` over whole table helps to resolve the issue for any WHERE clause, but than error returns after a while.

We are querying Aws Glue table directly(simple SELECT)

```auto
select * from "Aws glue".xxxx w
here id in (50372)

```

Log attached [63121f32-633a-4ffe-972a-96f4c7d1176e.zip](https://community.dremio.com/uploads/short-url/3HKnvP9eWbgww2gO8hZsSy9vW5p.zip) (19,0 )

Build  
25.0.7-202407181421320869-2632b04f  
Edition  
AWS Edition (activated)

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [September 25, 2024, 4:21am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/2 "2024-09-25T04:21:37Z")

</div>

@vladislav-stolyarov This is the actual error

```auto
Caused By (java.io.FileNotFoundException) Version of file changed data/media_segments/data.gz.parquet

```

UI query may work as it might be truncating the query. Can you please send us the UI profile too?

Any chance you are overwriting this file?

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [September 25, 2024, 2:13pm UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/3 "2024-09-25T14:13:09Z")

</div>

Yes you are right - we overwrite this file occasionally.  
Here how it looks like. So UI run was able to resolve metadata change and agter that API calls succeed.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/b/bd6172cd4c8af615ce615ccdac52f88f64c964a7.png)

This is ui call profile  
[d122ba14-9c6c-4ab0-92b8-fb2370558d03.zip](https://community.dremio.com/uploads/short-url/aNcFhoRlbXgiXxGBhz3EJl15weS.zip) (33,9 КБ)

Than my question is why UI call was able to reset error and start with new metadata, but api call not? is it possible to work this around in Rest api call?

Are there any other workarounds?

We have single file glue table without partitions, so can not do partition swicth of whatever, seems on prev versions of dremio this issue was not so critical.  
Should we call refresh metadata right after we changed file?

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [September 25, 2024, 8:50pm UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/4 "2024-09-25T20:50:52Z")

</div>

@vladislav-stolyarov This is expected behavior, if you see, the jobs has 2 attempts

attempt 1 - File not found  
attempt 2 - successful query

But if you also select job type internal, you will see another “REFRESH DATASET” job that was triggered between the 2 attempts, that is why the second attempt started 20 seconds later. I do not see any issues with this. The other option is what you are saying

- Delete file
- Add file
- Run “ALTER PDS REFRESH METADATA”
- Run UI or REST query

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [September 26, 2024, 9:02am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/5 "2024-09-26T09:02:25Z")

</div>

> [@balaji.ramaswamy](#):
>
> But if you also select job type internal, you will see another “REFRESH DATASET”

Yep but why this type of job is not triggered when query failed multiply times from REST? Only after UI query.

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [October 2, 2024, 5:31am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/6 "2024-10-02T05:31:59Z")

</div>

@vladislav-stolyarov Understood, it looks like the retry did not work via REST. Can you try via JDBC and see if the retry works? Just want to make sure it is indeed REST

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [October 2, 2024, 12:14pm UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/7 "2024-10-02T12:14:45Z")

</div>

For ODBC Client it does 2 attempts with metadata refresh behind the scenes.

[82025f33-19d8-4531-b859-dc2d3842ba7b.zip](https://community.dremio.com/uploads/short-url/jmW9IzYWgIPg3nTwzdxM24HjhG1.zip) (30,8 КБ)

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [October 3, 2024, 5:48am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/8 "2024-10-03T05:48:21Z")

</div>

Thanks for testing this, looks like REST is not automatically firing, we would need to prioritize and repro this internally, meanwhile, can u do below?

- File removed
- run ALTER PDS \<PDS\_NAME\> REFRESH METADATA
- run REST query

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [October 14, 2024, 11:59am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/9 "2024-10-14T11:59:02Z")

</div>

> [@balaji.ramaswamy](#):
>
> - File removed
> - run ALTER PDS \<PDS\_NAME\> REFRESH METADATA
> - run REST query

Sorry, missed your message.  
What do you mean under File removed? In our scenario file is overwritten, not fully removed. Do you want me to remove it and refresh metadata and run query?

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [October 18, 2024, 4:59pm UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/10 "2024-10-18T16:59:57Z")

</div>

@vladislav-stolyarov Sorry, I assumed file was removed, can you please try below

- File replaced
- Run “ALTER PDS REFRESH METADATA”
- run REST query

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [October 21, 2024, 2:58pm UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/11 "2024-10-21T14:58:46Z")

</div>

Yes it works fine. Thats the original solution we applied at the end.

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [October 25, 2024, 10:54am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/12 "2024-10-25T10:54:00Z")

</div>

Another one. As i told it works fine to manually call refresh metadata.  
But my problem is that it takes so long. 05m:06s to refresh it. Its a glue table with single parquet file (5.5 mb).  
Can you help.  
here is a profile if it helps  
[c2d0446d-fb70-4fac-a483-beed85aa03cb.zip](https://community.dremio.com/uploads/short-url/A7E6ELYC7MTK2fVBX5QQSbveybs.zip) (7,4 КБ)

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [October 27, 2024, 11:10pm UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/13 "2024-10-27T23:10:18Z")

</div>

@vladislav-stolyarov There will be an internal job called “REFRESH DATASET” for this table `"Aws glue"."fcp_live"."media_segments"`, can you please send that profile?

Click on Jobs page  
Job type choose only internal  
in search bar put `media_segments`

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [October 28, 2024, 9:25am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/14 "2024-10-28T09:25:20Z")

</div>

[3940a23a-d82f-4fd5-9c60-caf71a8d44c8.zip](https://community.dremio.com/uploads/short-url/mvl0oDf5veLzR4fkN6wyK587ZqJ.zip) (354,8 КБ)  
Attached profile.

meanwhile in last 3 days i can see refresh works fine in just 1-5 seconds, so looks like it was a temporal issue. The only change i did is added reflection over `media_segments`.

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [November 1, 2024, 1:11am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/15 "2024-11-01T01:11:03Z")

</div>

@vladislav-stolyarov All time spent on WRITER\_COMMITTER, this is a known limitation with PARQUET, are you having plans to move to Iceberg table format?

---

<div class="post-metadata">

### Author: ![vladislav-stolyarov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/vladislav-stolyarov/32/2351_2.png) [@vladislav-stolyarov](https://community.dremio.com/u/vladislav-stolyarov)
#### Post date: [November 8, 2024, 6:06pm UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/16 "2024-11-08T18:06:13Z")

</div>

Can you please elborate.  
I do not quite understand what does it mean and why changing from parquet to iceberg would help here? media\_segments is a single file parquet (5mb) dataset. I guess reading it and parsing wont take more than a couple of seconds.  
So what does dremio wait on and why wont it do thge same if media\_segments would be iceberg table not small parquet file.

Also interesting - from execution log over time period i can see that metadata refresh internal job takes either 1-3 seconds or 2.55-3:05 minutes, so this commit write wait has always pretty deteministic wait time.

---

<div class="post-metadata">

### Author: ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)
#### Post date: [November 13, 2024, 6:22am UTC](https://community.dremio.com/t/failure-during-setup-error-when-from-rest-application/12328/17 "2024-11-13T06:22:27Z")

</div>

@vladislav-stolyarov There are known limitations in the code that the WRITER\_COMMITTER takes time, for Iceberg Metadata rerfresh is completely eliminated
