docker icon indicating copy to clipboard operation
docker copied to clipboard

Blackfire APM attempting to run even if not configured

Open benjamin-smith opened this issue 3 years ago • 5 comments

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

  1. 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 avatar Mar 16 '22 14:03 benjamin-smith

@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.

jasonmccallister avatar Apr 06 '22 14:04 jasonmccallister

Adding something like this to your Dockerfile might help:

RUN rm /usr/local/etc/php/conf.d/ext-blackfire.ini

ralftar avatar May 27 '22 20:05 ralftar

@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 avatar May 28 '22 15:05 jawys

@jawys Indeed. Tip was in order to remove it from own dockerfile until permanently removed from source šŸ‘

ralftar avatar May 28 '22 15:05 ralftar

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.

cdenneen avatar Sep 09 '22 00:09 cdenneen

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?

juancferrer avatar Oct 27 '22 19:10 juancferrer

Currently a blocker for us. Running docker compose takes 5 minutes to startup due to the error mentioned in the initial report.

richardcalahan avatar Dec 16 '22 03:12 richardcalahan

@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 avatar Dec 16 '22 03:12 timkelty

@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.

richardcalahan avatar Dec 16 '22 03:12 richardcalahan

Yeah, I tend to agree.

timkelty avatar Dec 16 '22 03:12 timkelty

@jasonmccallister @timkelty Any updates on this? šŸ™‚ I also think that Blackfire should be removed from the images.

linusschwab avatar Jan 16 '23 10:01 linusschwab

@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.

jasonmccallister avatar Jan 16 '23 14:01 jasonmccallister

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 avatar Mar 06 '23 19:03 gligorkot

@gligorkot that should remove the extension for you. Can you try that and let us know if it works?

jasonmccallister avatar Mar 06 '23 21:03 jasonmccallister

@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 avatar Apr 17 '23 14:04 linusschwab

@linusschwab can you reach out to [email protected] and mention this GH issue? Thank you!

jasonmccallister avatar Apr 17 '23 14:04 jasonmccallister

Any news on this issue?

mihob avatar Aug 23 '23 08:08 mihob

@mihob Nothing official, but I think we just want to remove it.

On our list, but PRs welcome :)

timkelty avatar Aug 28 '23 16:08 timkelty

@timkelty if you agree I would open some hot-fix PR without digging too deep into the Dockerfile?

jawys avatar Aug 28 '23 18:08 jawys

@jawys yep. I'll get eyes on it if you submit! šŸ™

timkelty avatar Aug 28 '23 18:08 timkelty

@timkelty here you go! #83

jawys avatar Aug 29 '23 08:08 jawys

@timkelty here you go! #83

this can be closed since #83 is merged šŸŽ‰

jawys avatar Sep 04 '23 08:09 jawys