Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Cannot add again a scheduled query deleted from a pack #2243

Closed
polak785 opened this issue Jun 12, 2020 · 1 comment
Closed

Cannot add again a scheduled query deleted from a pack #2243

polak785 opened this issue Jun 12, 2020 · 1 comment

Comments

@polak785
Copy link

What version of fleet are you using (fleet version --full)?

fleet - version 2.5.0
branch: master
revision: 8e77f43
build date: 2020-01-26T22:02:00Z
build user: zwass
go version: go1.13.4

What operating system are you using?

Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

What did you do?

I want to add again a scheduled query that has been already added in a Pack and then deleted.

What did you expect to see?

The scheduled query should be added in the Pack

What did you see instead?

An error HTTP 500

And in the database, in table scheduled_queries, here there is the pack I want to update:

+----+---------------------+---------------------+---------------------+---------+---------+----------+----------+----------+---------+----------+---------+-------+-----------------------------------+-----------------------------------+-------------+
| id | created_at          | updated_at          | deleted_at          | deleted | pack_id | query_id | interval | snapshot | removed | platform | version | shard | query_name                        | name                              | description |
+----+---------------------+---------------------+---------------------+---------+---------+----------+----------+----------+---------+----------+---------+-------+-----------------------------------+-----------------------------------+-------------+
|  4 | 2020-03-16 13:50:21 | 2020-05-22 10:07:08 | NULL                |       0 |       3 |      123 |    86400 |        0 |       1 | linux    | NULL    |  NULL | Installed software list - Linux   | Installed software list - Linux   |             |
|  5 | 2020-03-16 13:50:34 | 2020-05-22 10:07:16 | NULL                |       0 |       3 |      124 |    86400 |        0 |       1 | darwin   | NULL    |  NULL | Installed software list - macOS   | Installed software list - MacOS   |             |
|  6 | 2020-03-16 13:50:51 | 2020-04-09 14:45:46 | 2020-04-09 14:45:46 |       1 |       3 |      135 |      300 |        1 |       0 | windows  | NULL    |  NULL | Installed software list - Windows | Installed software list - Windows |             |
| 14 | 2020-03-19 14:54:28 | 2020-06-12 15:22:31 | NULL                |       0 |       3 |      171 |    21600 |        1 |       0 | linux    | NULL    |  NULL | Web Browsers - Linux              | Web Browsers - Linux              |             |
+----+---------------------+---------------------+---------------------+---------+---------+----------+----------+----------+---------+----------+---------+-------+-----------------------------------+-----------------------------------+-------------+

I want to add again the query with the id 6


As a workaround, is this OK if I update the record in the database :

UPDATE scheduled_queries
SET deleted_at = NULL, deleted = 0
WHERE id = 6
@zwass
Copy link
Contributor

zwass commented Jul 7, 2020

This is a dupe of #2227.

Your workaround looks good.

@zwass zwass closed this as completed Jul 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants