-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker/docker.env variables not expanded to empty strings #6578
Comments
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. |
Dear @Stale, Despite what you may think, issues aren't magically fixed after 60 days. |
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know! |
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. |
Yes. |
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know! |
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. |
Yes. |
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know! |
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. |
. |
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know! |
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. |
This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it. |
I've had the same issue and same resolution as @JonathonReinhart here. Launching a fresh instance of Snipe-IT with docker-compose will throw errors when it tries to do database backups and a few other tasks, since it's trying to use the string "${MYSQL_PORT_3306_TCP_PORT}" instead of an integer port number. Setting MYSQL_PORT_3306_TCP_PORT=3306 in the .env file does fix this error. I think something in the conversion from local .env file (passed to docker-compose) to the generated .env file within Docker (that Snipe-IT actually uses) is not working; as was mentioned, if the environment variable is missing it should probably default to an empty string and let Snipe-IT use whatever defaults it wants, instead of passing the literal string, e.g. "${MYSQL_PORT_3306_TCP_PORT}". If there's no easy resolution to the root issue, I would recommend at least updating the example .env file at the Docker installation instructions to include the other needed variables, so nobody else runs into this. Thanks! |
@uberbrady @snipe Please reopen this issue representing a current bug, confirmed present in v5.0.11: |
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know! |
Looking at the running config,I see the following items with this problem:
(Still tracking down how these get in here like this) |
I feel like this is simply a limitation of PHP dotenv: <?php
require __DIR__.'/bootstrap/autoload.php';
use Dotenv\Dotenv;
$d = Dotenv::create(__DIR__);
$d->load();
print_r($_ENV);
?> Output:
|
I've reported this issue upstream: vlucas/phpdotenv#468 But, it will certainly be a while before it is fixed in So that means snipe-it is going to have to work around this. I think we're going to have to fix up the |
I'm running the
snipe/snipe-it:v4.6.7
Docker image viadocker-compose
. Of course, I modeled mydocker-compose.yml
off of the settings described in https://snipe-it.readme.io/docs/docker.(I'm actually setting up multiple instances to run against a single DB, due to #3520, and in-part #6501).
The relevant part of
docker-compose.yml
:Expected Behavior
I would expect no strange behavior with other environment variables
MYSQL_PORT_3306_TCP_PORT
environment variable is not set.Actual Behavior
It appears that environment variables which are not set, but referenced in
docker/docker.env
are kept as literals (and not expanded to empty strings as one would expect).This has caused (so far) the following bad behaviors:
${MAIL_ENV_FROM_ADDR}
(literal) shows up in several places:/setup
page:/setup/user?
page:${MYSQL_PORT_3306_TCP_PORT}
shows up on/admin/backups
after clicking:
MYSQL_PORT_3306_TCP_PORT
in mydocker-compose.yml
file and setting it to 3306.The text was updated successfully, but these errors were encountered: