# Fetch Remote Datasets task Exit: 0

**URL:** https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589
**Category:** CMS Features and Functionality
**Created:** [August 18, 2021, 4:24pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589 "2021-08-18T16:24:39Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [August 18, 2021, 4:24pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/1 "2021-08-18T16:24:40Z")

</div>

To be completed by the original poster:

# CMS Version

3.0.2

# Player Type

Windows

# Player Version

windows 3 R301.1-301

# Issue

Fetch Remote Datasets task is not completing. The task displays a bug icon with “Exit: 0” displayed on a mouseover.

All remote datasets are in an active layout.

I do not get any notifications or entries in the error log indicating any reason why this task is failing. I have my log level set to debug.

When I re-enabled the task to run manually, I got the same exit code of 0 with the bug icon, but datasets were updated.

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [August 20, 2021, 5:04pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/2 "2021-08-20T17:04:00Z")

</div>

I found the following messages in the debug logs when attempting to refresh the remote datasets:

```
|5608|a37c3b3|2021-08-20 11:31|CONSOLE|GET|DEBUG|||SET @taskId='16'; SET @name='Fetch Remote Datasets'; SET @status='1'; SET @pid='0'; SET @configFile='/tasks/remote-dataset.task'; SET @class='\Xibo\XTR\RemoteDataSetFetchTask'; SET @options='[]'; SET @schedule='30 * * * *'; SET @lastRunDt='1629477074'; SET @lastRunMessage='# Fetching Remote-DataSets No results for NVMS Chromebooks No results for Lunch Menu Middle Mealviewer Remote No results for Lunch Menu High Mealviewer Remote No results for Lunch Menu Elementary Mealviewer Remote No results for ESC Remote Building Calendar Wednesday No results for ESC Remote Building Calendar Tuesday No results for ESC Remote Building Calendar Thursday No results for ESC Remote Building Calendar Monday No results for ESC Remote Building Calendar Friday Done '; SET @lastRunStatus='4'; SET @lastRunDuration='3614'; SET @lastRunExitCode='0'; SET @isActive='1'; SET @runNow='0'; UPDATE `task` SET `name` = @name, `status` = @status, `pid` = @pid, `configFile` = @configFile, `class` = @class, `options` = @options, `schedule` = @schedule, `lastRunDt` = @lastRunDt, `lastRunMessage` = @lastRunMessage, `lastRunStatus` = @lastRunStatus, `lastRunDuration` = @lastRunDuration, `lastRunExitCode` = @lastRunExitCode, `isActive` = @isActive, `runNow` = @runNow WHERE `taskId` = @taskId|
|5609|a37c3b3|2021-08-20 11:31|CONSOLE|GET|ERROR|||Task run error for taskId 16. E = SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'lastRunMessage' at row 1|
```

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [October 18, 2021, 2:49pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/3 "2021-10-18T14:49:54Z")

</div>

I am continuing to get this error. I was able to briefly bypass it by removing some older remote datasets, but I have added a few new ones and the following error comes up when I attempt to fetch remote datasets:  
Task run error for taskId 19. E = SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘lastRunMessage’ at row 1

---

<div class="post-metadata">

### Author: ![sp\_etz](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/sp_etz/32/8924_2.png) [@sp\_etz](https://community.xibo.org.uk/u/sp_etz)
#### Post date: [December 2, 2021, 4:15pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/4 "2021-12-02T16:15:07Z")

</div>

Hi, did you find a solution? We upgraded from 2.3.12 to 3.0.4 and now encountering the same error. RemoteDataSet task runs for about an hour (every 10 min.) and then errors out and stops.  
Any tip is welcome 🙂

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [December 2, 2021, 4:28pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/5 "2021-12-02T16:28:41Z")

</div>

I have not found a solution. Sometimes I can have tasks run for days without issues and other times it errors out on every update.

---

<div class="post-metadata">

### Author: ![sp\_etz](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/sp_etz/32/8924_2.png) [@sp\_etz](https://community.xibo.org.uk/u/sp_etz)
#### Post date: [December 6, 2021, 7:29am UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/6 "2021-12-06T07:29:47Z")

</div>

Thank you, for your reply. I now see the same varying times before it errors out. Hope this somehow can be fixed.

---

<div class="post-metadata">

### Author: ![sp\_etz](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/sp_etz/32/8924_2.png) [@sp\_etz](https://community.xibo.org.uk/u/sp_etz)
#### Post date: [January 4, 2022, 10:59am UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/7 "2022-01-04T10:59:50Z")

</div>

Last couple of weeks the task ran without errors. Now we activated some (earlier created) datasets and the same error is there again. Even a manual start will only sporadically end well.

Is there any step I can take to debug this thing?

---

<div class="post-metadata">

### Author: ![sp\_etz](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/sp_etz/32/8924_2.png) [@sp\_etz](https://community.xibo.org.uk/u/sp_etz)
#### Post date: [January 7, 2022, 10:05am UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/8 "2022-01-07T10:05:43Z")

</div>

Sorry to bump this. But manually reactivating the task multiple times per day is no fun.  
Our conference center and department rosters are depending on remote datasets. In other words they are vital for our daily work (in our hospitals).

I’ll understand that there is no ready made fix, but I’m stuck at how to debug this problem. Hope someone at Xibo can give me any clues how to proceed!?

---

<div class="post-metadata">

### Author: ![DanBW](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/danbw/32/5608_2.png) [@DanBW](https://community.xibo.org.uk/u/DanBW)
#### Post date: [January 7, 2022, 11:05am UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/9 "2022-01-07T11:05:05Z")

</div>

Thank you for your message and for providing the details about the error. The `lastRunMessage` entry referenced in the error has a character limit of 255. The character count in your `lastRunMessage` is beyond this limit:

`# Fetching Remote-DataSets No results for NVMS Chromebooks No results for Lunch Menu Middle Mealviewer Remote No results for Lunch Menu High Mealviewer Remote No results for Lunch Menu Elementary Mealviewer Remote No results for ESC Remote Building Calendar Wednesday No results for ESC Remote Building Calendar Tuesday No results for ESC Remote Building Calendar Thursday No results for ESC Remote Building Calendar Monday No results for ESC Remote Building Calendar Friday Done`

The development team are aware of the issue and will fix this. I will also update this post with a link to the issue report so you can track its progress.

Many Thanks.

---

<div class="post-metadata">

### Author: ![DanBW](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/danbw/32/5608_2.png) [@DanBW](https://community.xibo.org.uk/u/DanBW)
#### Post date: [January 7, 2022, 11:38am UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/10 "2022-01-07T11:38:38Z")

</div>

Here is a link to the issue so you can track the fix:

> <https://github.com/xibosignage/xibo/issues/2702>
>
> The lastRunMessage column is limited to 255 characters in the database, when the… message is longer than that it will result in SQL error on update statement.
> 
> After that the task needs to be disabled and activated again to run.
> 
> We will need to truncate the lastRunMessage to 255 characters before attempting to update it in the database.

You can also apply the new patch for the fix to your current CMS installs by entering the following into your command line:

```auto
docker-compose exec cms-web bash
cd /var/www/cms
apk add patch
curl -sL https://github.com/PeterMis/xibo-cms/commit/18cc3e05337e09d62e57218d3df4a2b15836f478.diff | patch -p1
exit

```

Could you apply the patch using the above commands and confirm if the issue is resolved?

Many Thanks.

---

<div class="post-metadata">

### Author: ![sp\_etz](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/sp_etz/32/8924_2.png) [@sp\_etz](https://community.xibo.org.uk/u/sp_etz)
#### Post date: [January 8, 2022, 7:10pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/11 "2022-01-08T19:10:26Z")

</div>

Hi Dan, I manually adjusted Tasks.php with the lines from the commit. The apk-command did not work for me, probably due to our firewall. And as it is weekend now and our infrastructure department is not available, I did it this way.  
But the good news is that it seems to work 😃. I’m very, very, very happy!  
I will monitor for the coming hours, but I suspect this was all what’s needed.

Did I say I’m very happy with this fix? 😉 So thank you very much for your support, really appreciate it!

Regards, Harm

---

<div class="post-metadata">

### Author: ![sp\_etz](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/sp_etz/32/8924_2.png) [@sp\_etz](https://community.xibo.org.uk/u/sp_etz)
#### Post date: [January 9, 2022, 3:06pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/12 "2022-01-09T15:06:43Z")

</div>

20h later; task is still running without problems.

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [March 16, 2022, 8:03pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/13 "2022-03-16T20:03:00Z")

</div>

I am getting this error again. Task 19 is “Fetch Remote Datasets” for me. I’m running 3.0.8

```auto
Task run error for taskId 19. E = SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'lastRunMessage' at row 1

```

---

<div class="post-metadata">

### Author: ![DanBW](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/danbw/32/5608_2.png) [@DanBW](https://community.xibo.org.uk/u/DanBW)
#### Post date: [March 21, 2022, 12:01pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/14 "2022-03-21T12:01:16Z")

</div>

Hi Callen\_Magnuson, thank you for the update. I have been trying to replicate your issue on 3.0.8 and so far I have had no luck getting that error to appear.

Please can you send me screenshots showing:

- The error in your 3.0.8 CMS.
- The lastRunMessage for your Fetch Remote Dataset task from the last run. If you go to the Tasks page in your CMS and highlight the tick under the `Last Status` column for the task it will show the message being returned.

Many Thanks.

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [March 21, 2022, 12:54pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/15 "2022-03-21T12:54:38Z")

</div>

Here are the two screenshots.

 ![dataseterror](https://community.xibo.org.uk/uploads/default/original/2X/9/95c5b4464237c42b5e5aca8bc4c334fba10f4725.png)  
 ![lastrunerror](https://community.xibo.org.uk/uploads/default/original/2X/e/e4dff283f6f4e18cd8b620838aefc53dd89cc0d5.png)

---

<div class="post-metadata">

### Author: ![DanBW](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/danbw/32/5608_2.png) [@DanBW](https://community.xibo.org.uk/u/DanBW)
#### Post date: [March 21, 2022, 1:32pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/16 "2022-03-21T13:32:31Z")

</div>

Thank you for your screenshots of the issue. Below is a link to the Task.php where you can see the fix for the issue you reported was resolved. The fix begins on line 503 and ends on line 506. Please can you go to lib/Controller/Task.php for your local install and make sure that the same appears on lines 503-506?

> **[xibo-cms/lib/Controller/Task.php at release30 · xibosignage/xibo-cms](https://github.com/xibosignage/xibo-cms/blame/release30/lib/Controller/Task.php#L503)**
>
> Xibo Content Management System. Contribute to xibosignage/xibo-cms development by creating an account on GitHub.

Many Thanks.

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [March 21, 2022, 2:36pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/17 "2022-03-21T14:36:02Z")

</div>

The lines are identical

---

<div class="post-metadata">

### Author: ![DanBW](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/danbw/32/5608_2.png) [@DanBW](https://community.xibo.org.uk/u/DanBW)
#### Post date: [March 21, 2022, 4:45pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/18 "2022-03-21T16:45:02Z")

</div>

Thank you for confirming that the lines are the same in your Task.php file. Please can you run the following query in your CMS database and confirm the output?

`describe `task`;`

This guides explains how to run commands against your database when using a docker based installation:

> [@How can I run a SQL command when using a Docker Install?](https://community.xibo.org.uk/t/how-can-i-run-a-sql-command-when-using-a-docker-install/9946):
>
> While troubleshooting an issue you maybe asked to run a SQL statement on your database Docker container, or you may want to run a statement yourself for another purpose. To do either of these things there are two options. Using the command line Using the GUI called PhpMyAdmin Command Line Before you can run a statement inside the docker container you will need to find the container name. This can be done using the docker ps command. The resulting output will show a list of running docker con…

Many Thanks.

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [March 21, 2022, 5:04pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/19 "2022-03-21T17:04:27Z")

</div>

```auto
MySQL [cms]> describe `task`;
+-----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+----------------+
| taskId | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(254) | NO | | NULL | |
| class | varchar(254) | NO | | NULL | |
| status | tinyint(4) | NO | | 2 | |
| pid | int(11) | YES | | NULL | |
| options | text | YES | | NULL | |
| schedule | varchar(254) | YES | | NULL | |
| lastRunDt | int(11) | YES | | NULL | |
| lastRunMessage | varchar(254) | YES | | NULL | |
| lastRunStatus | tinyint(4) | NO | | 0 | |
| lastRunDuration | smallint(6) | YES | | NULL | |
| lastRunExitCode | smallint(6) | YES | | NULL | |
| isActive | tinyint(4) | NO | | 1 | |
| runNow | tinyint(4) | NO | | 1 | |
| configFile | varchar(254) | NO | | NULL | |
| lastRunStartDt | int(11) | YES | | NULL | |
+-----------------+--------------+------+-----+---------+----------------+
16 rows in set (0.001 sec)

```

---

<div class="post-metadata">

### Author: ![Callen\_Magnuson](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/callen_magnuson/32/10697_2.png) [@Callen\_Magnuson](https://community.xibo.org.uk/u/Callen_Magnuson)
#### Post date: [May 9, 2022, 3:20pm UTC](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589/20 "2022-05-09T15:20:32Z")

</div>

I am still having this issue, and as of the latest release, all of the above troubleshooting gives identical results.

[Next page](https://community.xibo.org.uk/t/fetch-remote-datasets-task-exit-0/25589.md?page=2)
