Blackfire APM attempting to run even if not configured
Description
We are seeing [Error] APM: Locking APM for 300 seconds for reason: Cannot connect to the agent very frequently in our logs. I assume this is coming from Blackfire, as it is installed in these images (https://github.com/craftcms/docker/blob/009b99067c4b725c78c1a032abde804856484033/7.4/Dockerfile#L127-L131).
I worry there is some type of performance hit here for those not actually using Blackfire. Is it mandatory to include this in these images? Would a ENV var toggle be appropriate here, or removing it entirely?
Steps to reproduce
- Run container, view logs
Additional info
- Craft version: 3.7.34
- PHP version: 7.4.28
- Database driver & version: MySQL 5.7.31
- Plugins & versions: n/a
@benjamin-smith there are not supposed to be any performance hits with Blackfire in production. However, I think it may be best to remove from the image and allow people to install if they need/want Blackfire.
@timkelty I think we should just remove Blackfire as it does not work as intended in Nitro v2 and we use new images in Nitro v3.
Adding something like this to your Dockerfile might help:
RUN rm /usr/local/etc/php/conf.d/ext-blackfire.ini
@ralftar Sounds like this would increase the resulting image layers. Goal should be to reduce them instead.
I like what @jasonmccallister said about just removing it now and adding it in nitro v3 maybe
@jawys Indeed. Tip was in order to remove it from own dockerfile until permanently removed from source š
Is there a suggested config to make it run? Any idea why it was added to the base Dockerfile to begin with? Looks like there is absolutely no "free" version of this APM so most people couldn't use it.
Any idea if this could cause the application to not load? I'm running craftcms docker image on heroku, with cloudflare in front, and today cloudflare started displaying an error page. "Web server is returning an unknown error".
I look in the heroku logs, and I see this [Error] APM: Locking APM for 300 seconds for reason: Cannot connect to the agent
Now a few minutes later, the application is working, and I'm not seeing those error message in the logs anymore.
Looks like maybe blackfire had an outage and it affected the applications?
Currently a blocker for us. Running docker compose takes 5 minutes to startup due to the error mentioned in the initial report.
@richardcalahan I'm doing some updates so I'll try and revitalize this ā I think everyone would probably be better off if we just removed blackfire from non-dev images.
@timkelty Also from the dev images in my opinion. That's where we're hitting these startup issues. Feels like it should be an opt-in for dev and prod.
Yeah, I tend to agree.
@jasonmccallister @timkelty Any updates on this? š I also think that Blackfire should be removed from the images.
@linusschwab we have been working on new images that are currently private and solve a bunch of other issues. Iām not sure when we will be releasing those publicly, but we will update this post when we do.
I believe one of our production environments has been hit by this as well today. Have people found a way to turn it off in their docker images? Does adding this stop it from running?
RUN rm /usr/local/etc/php/conf.d/ext-blackfire.ini
@gligorkot that should remove the extension for you. Can you try that and let us know if it works?
@jasonmccallister Is there already an ETA? Personally I'm really looking forward to the improvements, especially the fixes that you mentioned š would it maybe be possible to release it as a beta or RC version or to get some kind of private preview version that could be used as a base image until it is fully ready?
@linusschwab can you reach out to [email protected] and mention this GH issue? Thank you!
Any news on this issue?
@mihob Nothing official, but I think we just want to remove it.
On our list, but PRs welcome :)
@timkelty if you agree I would open some hot-fix PR without digging too deep into the Dockerfile?
@jawys yep. I'll get eyes on it if you submit! š
@timkelty here you go! #83
@timkelty here you go! #83
this can be closed since #83 is merged š