Skip to content
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

Blackfire "agent socket" not reachable as 127.0.0.1 (in Local Beach) #2

Open
kdambekalns opened this issue Oct 29, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@kdambekalns
Copy link
Member

The update to Blackfire v2 works fine if the BLACKFIRE_AGENT_SOCKET is set correctly in Local Beach. Otherwise you get a hard-to-debug message

Are you authorized to profile this page? No probe response, missing PHP extension or invalid signature for relaying agent.

when trying to debug HTTP requests (blackfire run inside Local Beach works fine!)

@kdambekalns kdambekalns added the bug Something isn't working label Oct 29, 2021
@kdambekalns kdambekalns self-assigned this Oct 29, 2021
@kdambekalns
Copy link
Member Author

kdambekalns commented Oct 29, 2021

Observations for Local Beach

These are needed environment variables for the blackfire/blackfire container:

      - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID}
      - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN}
      - BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID}
      - BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN}

That's what is needed, says their documentation. One can add these to get more logging and remove a warning:

      - BLACKFIRE_LOG_LEVEL=3
      - BLACKFIRE_DISABLE_LEGACY_PORT=true

These are needed environment variables for the flownative/beach-php container:

      - BEACH_ADDON_BLACKFIRE_ENABLE=true
      - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID}
      - BLACKFIRE_CLIENT_TOKEN=…${BLACKFIRE_CLIENT_TOKEN}
      - BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID}
      - BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN}
      - BLACKFIRE_AGENT_SOCKET=tcp://<project-name>_blackfire.local_beach:8307

Internally, it's a bit weird right now… BEACH_ADDON_BLACKFIRE_SERVER_* are set from BLACKFIRE_SERVER_* if not defined:

export BEACH_ADDON_BLACKFIRE_SERVER_ID=${BEACH_ADDON_BLACKFIRE_SERVER_ID:-${BLACKFIRE_SERVER_ID:-}}
export BEACH_ADDON_BLACKFIRE_SERVER_TOKEN=${BEACH_ADDON_BLACKFIRE_SERVER_TOKEN:-${BLACKFIRE_SERVER_TOKEN:-}}

And then BLACKFIRE_SERVER_* are (re-)set from BEACH_ADDON_BLACKFIRE_SERVER_*:

export BLACKFIRE_SERVER_ID=${BEACH_ADDON_BLACKFIRE_SERVER_ID}
export BLACKFIRE_SERVER_TOKEN=${BEACH_ADDON_BLACKFIRE_SERVER_TOKEN}

I suggest to drop BEACH_ADDON_BLACKFIRE_SERVER_* completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant