jby
12/01/2021, 10:53 AMRachel Perkins
12/01/2021, 3:40 PMnpm view fleetctl version
We're on 4.6.1 but feel free to update if you're not!jby
12/01/2021, 3:53 PMRachel Perkins
12/01/2021, 4:58 PMfleetctl preview
, it should automatically upgrade to 4.6.1jby
12/01/2021, 5:00 PMRachel Perkins
12/01/2021, 5:00 PMfleetctl --version
instead of npm view fleetctl version
jby
12/01/2021, 5:12 PMRachel Perkins
12/01/2021, 5:42 PMfleetctl preview stop
first if you'd like, but it works without itjby
12/01/2021, 5:45 PMfleetctl preview
and now I can’t login anymore… 😞<mailto:admin@example.com|admin@example.com>
user, but all my data from before the upgrade
seems to be gone… 😞Rachel Perkins
12/03/2021, 3:41 PMfleetctl preview
automatically logs you injby
12/03/2021, 4:13 PMfleetctl preview
“on top” of the one I already had running…Lucas Rodriguez
12/03/2021, 4:16 PMjby
12/03/2021, 4:17 PMfleetctl preview
to upgrade the existing, running preview that I had:
Downloading dependencies from production into /root/.fleet/preview...
Pulling Docker dependencies...
Starting Docker containers...
Waiting for server to start up...
Initializing server...
Configured fleetctl in the 'preview' context to avoid overwriting existing config.
Loading standard query library...
Applying Policies...
Fleet will now enroll your device and log you into the UI automatically.
You can also open the UI at this URL: <http://localhost:1337/previewlogin>.
Email: <mailto:admin@example.com|admin@example.com>
Password: admin123#
Downloading Orbit and osqueryd...
Orbit is already running.
Waiting for current host to enroll...
wait for current host: checking host count: no hosts yet
Lucas Rodriguez
12/06/2021, 7:51 PMdocker volume list | grep preview
local fleet-preview-server_data01
after running preview
jby
12/06/2021, 7:52 PMdocker volume list
DRIVER VOLUME NAME
local 34a78f9c63dc93fc533c362a5c00f04ffa2b43cfc555062ad2ca979a18fa4f4c
local 625e94d725d58ea087bcee640687433cb40f58daed0a3ae8714afd6aed4bbfc4
local fleet-preview-server_data01
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
88b39d78b8d7 fleetdm/fleet:latest "sh -c '/usr/bin/fle…" 4 days ago Up 4 days 0.0.0.0:1337->1337/tcp, :::1337->1337/tcp fleet-preview-server_fleet02_1
878d60386228 fleetdm/fleet:latest "sh -c '/usr/bin/fle…" 4 days ago Up 4 days 0.0.0.0:8412->8412/tcp, :::8412->8412/tcp fleet-preview-server_fleet01_1
b52496386962 mysql:5.7 "docker-entrypoint.s…" 4 days ago Up 4 days 33060/tcp, 0.0.0.0:3308->3306/tcp, :::3308->3306/tcp fleet-preview-server_mysql01_1
d42f75ce59ee redis:6 "docker-entrypoint.s…" 4 days ago Up 4 days 6379/tcp fleet-preview-server_redis01_1
ac4363885609 dactiv/osquery:4.5.1-centos6 "osqueryd --flagfile…" 4 weeks ago Up 4 weeks fleet-preview-devices_centos6-osquery_1
393ee09aa659 dactiv/osquery:4.5.1-ubuntu18.04 "osqueryd --flagfile…" 4 weeks ago Up 4 weeks fleet-preview-devices_ubuntu18-osquery_1
b6e3aa740d4f dactiv/osquery:4.5.1-centos7 "osqueryd --flagfile…" 4 weeks ago Up 4 weeks fleet-preview-devices_centos7-osquery_1
a2a4763bab36 dactiv/osquery:4.5.1-ubuntu16.04 "osqueryd --flagfile…" 4 weeks ago Up 4 weeks fleet-preview-devices_ubuntu16-osquery_1
bc112570d19b dactiv/osquery:4.5.1-ubuntu14.04 "osqueryd --flagfile…" 4 weeks ago Up 4 weeks fleet-preview-devices_ubuntu14-osquery_1
9ee8c3357bb8 dactiv/osquery:4.5.1-centos8 "osqueryd --flagfile…" 4 weeks ago Up 4 weeks fleet-preview-devices_centos8-osquery_1
66b70a2e1d48 dactiv/osquery:4.5.1-ubuntu20.04 "osqueryd --flagfile…" 4 weeks ago Up 4 weeks fleet-preview-devices_ubuntu20-osquery_1
Lucas Rodriguez
12/06/2021, 7:56 PMpreview
starts a set of simulated hosts so that people can start testing running queries etc with N > 1 hosts.fleet-preview-server_data01
is the new volume that started from scratch with no data (your current run) and one of the other two is the volume with the old data?jby
12/06/2021, 7:58 PMfleet-preview-server_data01
volume is since I started my first preview:
# docker volume inspect fleet-preview-server_data01
[
{
"CreatedAt": "2021-11-04T05:59:38Z",
"Driver": "local",
"Labels": {
"com.docker.compose.project": "fleet-preview-server",
"com.docker.compose.version": "1.27.4",
"com.docker.compose.volume": "data01"
},
"Mountpoint": "/var/lib/docker/volumes/fleet-preview-server_data01/_data",
"Name": "fleet-preview-server_data01",
"Options": null,
"Scope": "local"
}
]
CreatedAt
, my login after running fleetctl preview
last week:
docker volume inspect 34a78f9c63dc93fc533c362a5c00f04ffa2b43cfc555062ad2ca979a18fa4f4c
[
{
"CreatedAt": "2021-12-02T06:44:22Z",
"Driver": "local",
"Labels": null,
"Mountpoint": "/var/lib/docker/volumes/34a78f9c63dc93fc533c362a5c00f04ffa2b43cfc555062ad2ca979a18fa4f4c/_data",
"Name": "34a78f9c63dc93fc533c362a5c00f04ffa2b43cfc555062ad2ca979a18fa4f4c",
"Options": null,
"Scope": "local"
}
]
docker volume inspect 625e94d725d58ea087bcee640687433cb40f58daed0a3ae8714afd6aed4bbfc4
[
{
"CreatedAt": "2021-12-06T19:59:04Z",
"Driver": "local",
"Labels": null,
"Mountpoint": "/var/lib/docker/volumes/625e94d725d58ea087bcee640687433cb40f58daed0a3ae8714afd6aed4bbfc4/_data",
"Name": "625e94d725d58ea087bcee640687433cb40f58daed0a3ae8714afd6aed4bbfc4",
"Options": null,
"Scope": "local"
}
]
Lucas Rodriguez
12/06/2021, 8:20 PMpreview stop
2. remove the new empty volume, 3. run preview
again and see if that uses the old volume.jby
12/06/2021, 8:22 PMdocker volume rm 625e94d725d58ea087bcee640687433cb40f58daed0a3ae8714afd6aed4bbfc4
Error response from daemon: remove 625e94d725d58ea087bcee640687433cb40f58daed0a3ae8714afd6aed4bbfc4: volume is in use - [d42f75ce59ee4d887c26097a4afa2939ee82aad99bf704fb2b10dd8b5bb47e9c]
Lucas Rodriguez
12/06/2021, 8:23 PMjby
12/06/2021, 8:23 PMLucas Rodriguez
12/06/2021, 8:23 PMjby
12/06/2021, 8:24 PMLucas Rodriguez
12/06/2021, 9:05 PMdocker logs $container_id_of_fleetdm/fleet
(docker ps
).jby
12/06/2021, 9:50 PM3dc39fc12db2 fleetdm/fleet:latest "sh -c '/usr/bin/fle…" About an hour ago Up About an hour 0.0.0.0:8412->8412/tcp, :::8412->8412/tcp fleet-preview-server_fleet01_1
dd454af52c6c mysql:5.7 "docker-entrypoint.s…" About an hour ago Up About an hour 33060/tcp, 0.0.0.0:3308->3306/tcp, :::3308->3306/tcp fleet-preview-server_mysql01_1
75d2cc6a59ed redis:6 "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp fleet-preview-server_redis01_1
88b39d78b8d7 fleetdm/fleet:latest "sh -c '/usr/bin/fle…" 4 days ago Up About an hour 0.0.0.0:1337->1337/tcp, :::1337->1337/tcp fleet-preview-server_fleet02_1
Lucas Rodriguez
12/07/2021, 5:30 PMjby
12/07/2021, 5:35 PMLucas Rodriguez
12/07/2021, 5:41 PMjby
12/07/2021, 5:42 PMfleetctl preview
and to an instance running, created a couple of users and created pkgs and installed on a couple of Macs and a couple of Linux clients. It worked great.
• I thought I’d upgrade to newer versinos - asked here and got the info that re-running fleetctl preview
would upgrade what I had, and keep the data intact.
• Re-ran the fleetctl preview
got a totally empty instance, no example data, and none of my old data in it, and no users.
• Restarted (fleetctl preview stop
followed by fleetctl preview
- this seems to have re-provisioned the instance with example data but still no sign of the data from my clients and my users are gone again…Lucas Rodriguez
12/08/2021, 4:27 PMmysql --host=127.0.0.1 --port=3308 --user=root --password
# password is toor
And check if your data is there running:
select * from fleet.hosts;
Then check if the mysql container is using the one data volume in your system, if it is using it then it may have been overwritten accidentally or by fleetctl preview
. (We haven't gotten any reports about this yet.)
@zwass Do you happen to know if fleetctl preview
could accidentally override a previous preview mysql volume? See https://osquery.slack.com/archives/C01DXJL16D8/p1638900269318900?thread_ts=1638356010.214300&cid=C01DXJL16D8zwass
fleetctl preview reset
would clear out all the data -- additionally any change to the Docker installation could do this. If you find yourself creating multiple users and attaching multiple other hosts that you want to keep in there for an extended period of time I think you probably have outgrown preview and would want to set up a "real" environment (even if it's just on something like render.com: https://blog.fleetdm.com/deploying-fleet-on-render-2d743aed213f)jby
12/08/2021, 4:31 PMzwass
jby
12/21/2021, 6:27 AMfleetctl preview
command. I specifically asked if that would affect the data in my running instance and was told it wouldn’t. I followed the given instructions and ended up without both my previous data and the example data. I found the docker container with my data and thought that I’d get help re-connecting that to the new preview instance - then just silence