Skip to content

Enabling debugging with autoinstall via env variables seems brocken #284

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

Open
ne20002 opened this issue Feb 3, 2025 · 5 comments
Open

Comments

@ne20002
Copy link
Collaborator

ne20002 commented Feb 3, 2025

I created a new instance with docker-compose (using autoinstall) where the env variables

      - FRIENDICA_LOGFILE=/tmp/friendica.log
      - FRIENDICA_LOGLEVEL=debug
      - FRIENDICA_DEBUGGING=true

are set.

Executing into the friendica container before trying to register the admin user showed that no log has been created. The env variables passed are available.

After registering the admin user with bin/console user add and logging into the instance the Logs settings under Admin showed:

Image

It seems obvious that the log is not created and logging not enabled as expected.

@ne20002
Copy link
Collaborator Author

ne20002 commented Feb 3, 2025

@MrPetovan maybe you can help here. The env variables mentioned above are not handled in the docker scripts so I assume that they are handled by friendica and found in /src/Core/Config/Util/ConfigFileManager.php:100 the only reference which seem to load the env variables into a config cache.

Is there any trick how I can take a look at the config cache at runtime? I don't have an IDE or development tools available as I need to do this inside the docker container.

@MrPetovan
Copy link
Collaborator

If you can edit files in the container, you can add var_dump($this->config); at the end of Friendica\Core\Config\ValueObject\Cache->load in src/Core/Config/ValueObject/Cache.php on line 96:

https://github.com/friendica/friendica/blob/9d506071c8c53199b6e8183589a008632e3f3646/src/Core/Config/ValueObject/Cache.php#L81-L97

@ne20002
Copy link
Collaborator Author

ne20002 commented Feb 5, 2025

@m33m33, @comradeferret Maybe you can help.

I trying to get the installation running with the current dev version but it still fails. I thought that with enabled logging in the docker container I can get a bit more information. But I don't get the logging (into friendica.log) working in the container before I start the install wizard or try to register the admin user in the login page. It's just not there.

I created two issues #286, #287 to keep track of the current state and the docker-compose file I use.

Can you please try if you get the log working? Or just check if you have the same behaviour? It would be really helpful to get the debug logging enabled.

As the used env variables are not used within the wizard or the autoinstall I'm not sure even if it can be enabled before the setup is finished.

Alternativly, do you have an idea how to enable php logging? Maybe this helps.

@comradeferret
Copy link

@ne20002 I couldn't get the dev version working either, I just use the stable.

@ne20002
Copy link
Collaborator Author

ne20002 commented Feb 26, 2025

The env for log file has been working with fpm image today. Need to recheck with apache image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants