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

Inspector not working in Laravel app #99

Open
binaryfire opened this issue Nov 25, 2023 · 7 comments · Fixed by #100
Open

Inspector not working in Laravel app #99

binaryfire opened this issue Nov 25, 2023 · 7 comments · Fixed by #100
Assignees
Labels
Milestone

Comments

@binaryfire
Copy link

binaryfire commented Nov 25, 2023

Hi guys

It seems Inspector isn't working in Laravel. Sending to inspector.dev works correctly but not sending to Buggregator. I'm using the latest v1.0.0 Docker image.

The docs say this should be the config:

INSPECTOR_URL=http://inspector@127.0.0.1:8000
INSPECTOR_API_KEY=test
INSPECTOR_INGESTION_KEY=1test
INSPECTOR_ENABLE=true

But this line in the Inspector EventHandler suggests the uri should end with inspector?

I tried the above config and the following two configs with no luck:

INSPECTOR_URL=http://127.0.0.1:8000/api/inspector
INSPECTOR_API_KEY=test
INSPECTOR_INGESTION_KEY=1test
INSPECTOR_ENABLE=true
INSPECTOR_URL=http://127.0.0.1:8000/inspector
INSPECTOR_API_KEY=test
INSPECTOR_INGESTION_KEY=1test
INSPECTOR_ENABLE=true

Any ideas?

Thanks again!

@butschster
Copy link
Member

Hi @binaryfire,

If you are using it inside a Docker container, it might be something like:

INSPECTOR_URL: http://inspector@buggregator:8000
INSPECTOR_API_KEY: test

Where buggregator is the container name.

Alternatively, the issue could be incorrect port mapping. If you map a port inside the container to your host server, like -p 8080:8000, then you should use port 8080.

@binaryfire
Copy link
Author

binaryfire commented Nov 25, 2023

Hi @butschster

Yeah actually I'm using the container name (buggregator). I used 127.0.0.1 in the examples above to avoid confusion :) I don't think that's the problem because these work perfectly:

RAY_HOST=ray@buggregator
RAY_PORT=8000

LOG_CHANNEL=socket
LOG_SOCKET_URL=buggregator:9913

VAR_DUMPER_FORMAT=server
VAR_DUMPER_SERVER=tcp://buggregator:9912

MAIL_MAILER=smtp
MAIL_HOST=buggregator
MAIL_PORT=1025

Also http-dumps to http://http-dump@bolt-buggregator:8000 work

But Inspector doesn't with either of these:

INSPECTOR_URL=http://inspector@buggregator:8000
INSPECTOR_API_KEY=test
INSPECTOR_INGESTION_KEY=1test
INSPECTOR_ENABLE=true

or

INSPECTOR_URL=http://inspector@buggregator:8000
INSPECTOR_API_KEY=test

@butschster
Copy link
Member

Hmmm. I you the same settings in examples,

services:
  examples:
    build: "./docker/examples"
    environment:
      APP_ENV: production
      APP_KEY: xxx
      LOG_LEVEL: debug
      BROADCAST_DRIVER: log
      CACHE_DRIVER: array
      QUEUE_CONNECTION: sync
      DB_CONNECTION: sqlite
      DB_DATABASE: ":memory:"
      MAIL_HOST: buggregator
      MAIL_PORT: 1025
      MAIL_ENCRYPTION: null
      MAIL_FROM_ADDRESS: sender@site.com
      MAIL_FROM_NAME: sender
      RAY_HOST: ray@buggregator
      RAY_PORT: 8000
      VAR_DUMPER_SERVER: buggregator:9912
      SENTRY_LARAVEL_DSN: http://sentry@buggregator:8000/123
      LOG_SOCKET_URL: buggregator:9913
      LOG_SLACK_WEBHOOK_URL: http://buggregator:8000/slack
      INSPECTOR_URL: http://inspector@buggregator:8000
      INSPECTOR_API_KEY: test
      PROFILER_ENDPOINT: http://profiler@buggregator:8000
    ports:
      - 9020:8000
  buggregator:
    image: ghcr.io/buggregator/server:latest

@binaryfire
Copy link
Author

binaryfire commented Nov 25, 2023

Weird. Sentry isn't working for me either:

SENTRY_LARAVEL_DSN=http://sentry@buggregator:8000/1

Sending to sentry.io works, and I've had it working with Buggregator in other PHP apps with the same Docker setup. So I'm not sure what's going on with that one either. Could it be a problem with their new SDK? They released v4.0.0 last week which has some major changes: https://github.com/getsentry/sentry-laravel/releases

@butschster
Copy link
Member

Weird. Sentry isn't working for me either:

SENTRY_LARAVEL_DSN=http://sentry@buggregator:8000/1

Sending to sentry.io works, and I've had it working with Buggregator in other PHP apps with the same Docker setup. So I'm not sure what's going on with that one either. Could it be a problem with their new SDK? They released v4.0.0 last week which has some major changes: https://github.com/getsentry/sentry-laravel/releases

In my opinion, no!

There is the same problem with Sentry on buggreagor.dev. It doesn't work. But locally inside Docker with the same settings, it works well. I'll try to dig deeper to discover the problem.

Could you try to clear the config cache?

I noticed that there are some main changes in the Laravel framework like this change in https://github.com/laravel/framework/blob/10.x/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php#L96 which disable setting symfony/var-dumper via the .env file. Now, there is only one way to set it up, for example, inside bootstrap/app.php like this:

$app = new Illuminate\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

// var dumper setting
$_SERVER['VAR_DUMPER_FORMAT'] = 'server';
$_SERVER['VAR_DUMPER_SERVER'] = 'if-buggregator:9912';

@butschster butschster linked a pull request Dec 1, 2023 that will close this issue
@binaryfire
Copy link
Author

Hi @butschster. Thanks for the update! Sentry is working in Laravel now 🎉

But Inspector still isn't for some reason. This is my config:

INSPECTOR_URL=http://inspector@buggregator:8000
INSPECTOR_API_KEY=test
INSPECTOR_INGESTION_KEY=1test
INSPECTOR_ENABLE=true

Connecting to inspector.dev works and requests show up in the dashboard so the inspector-apm/inspector-laravel package is working properly. Maybe there's an incompatibility somewhere?

@butschster
Copy link
Member

Hi @binaryfire.

I'll try to cover your case with tests, and I'm confident everything will work fine. I'm currently working on the tests and addressing any incompatibilities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants