https://github.com/osquery/osquery logo
#fleet
Title
# fleet
m

Mo Zhu

05/09/2022, 4:51 PM
I have the docker image deployed to a heroku, but I am stuck on getting the server app connected to mysql and redis. I am running
fleet prepare db
but the error
failed to start: creating db connection: default addr for network '<http://us-cdbr-east-05.cleadb.net/asdfasdfasdf|us-cdbr-east-05.cleadb.net/asdfasdfasdf>' unknown
. It seems to not know the URL for that db, but that’s the url provided by heroku in their server env variables.
m

Michal Nicpon

05/09/2022, 5:27 PM
How are you setting the fleet mysql address? Can you paste the value you are using (make sure you replace any sensitive info like username and password)?
m

Mo Zhu

05/09/2022, 7:02 PM
Hi! Yes, I have an env variable set to:
FLEET_MYSQL_ADDRESS: <mysql://xxx:xxx@us-cdbr-east-05.cleardb.net/heroku_e825c9bd49d3cbb?reconnect=true>
and that
mysql://
address is given by the cleardb mysql heroku add-on.
I basically made the configuration in heroku env variables to match here.
I am assuming that the only one that I have to get right here is the MYSQL_ADDRESS. The other ones I can specify however I want and
fleet prepare db
will do the rest?
m

Michal Nicpon

05/09/2022, 7:07 PM
Ah, I see the problem. Fleet expects the database configuration to be provided via multiple environment variables
FLEET_MYSQL_ADDRESS
,
FLEET_MYSQL_DATABASE
,
FLEET_MYSQL_USERNAME
,
FLEET_MYSQL_PASSWORD
. See https://fleetdm.com/docs/deploying/configuration#my-sql
m

Mo Zhu

05/09/2022, 7:09 PM
I did set all of these:
FLEET_MYSQL_ADDRESS
,
FLEET_MYSQL_DATABASE
,
FLEET_MYSQL_USERNAME
,
FLEET_MYSQL_PASSWORD
. But are you saying that they need to be specific strings that match the set up of the db?
m

Michal Nicpon

05/09/2022, 7:10 PM
you were trying to pass everything in via
FLEET_MYSQL_ADDRESS
. In this case, you need to do
Copy code
FLEET_MYSQL_ADDRESS=<http://us-cdbr-east-05.cleardb.net:3306|us-cdbr-east-05.cleardb.net:3306>
FLEET_MYSQL_DATABASE=heroku_e825c9bd49d3cbb
FLEET_MYSQL_USERNAME=xxx
FLEET_MYSQL_PASSWORD=xxx
m

Mo Zhu

05/09/2022, 7:10 PM
ohhh I see I see
let me try… thank you
worked great!
I’m running into a new issue now… will investigate and come back if I can’t figure it out…
👍 1
but at least it’s a new issue, so that’s progress!
by the way, how did you know to use port 3306? Is that some kind of standard convention?
m

Michal Nicpon

05/09/2022, 7:20 PM
3306 is the default mysql port
m

Mo Zhu

05/09/2022, 7:22 PM
ah i see
7 Views