-
-
Notifications
You must be signed in to change notification settings - Fork 325
Profile is not present for current request #737
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
Comments
I think there likely is a subtle bug or incompatibility within the Clockwork library specifically when interacting with the FrankenPHP SAPI's lifecycle or filesystem handling during its requestProcessed phase. Let me demonstrate this through the following code placed right before declaring try {
$profileFile = xdebug_get_profiler_filename();
if ($profileFile) {
$fileExists = file_exists($profileFile);
$clockwork->log()->info("Xdebug profile check: File='{$profileFile}', Exists=" . ($fileExists ? 'true' : 'false'));
} else {
$clockwork->log()->warning("Xdebug profile check: xdebug_get_profiler_filename() returned empty.");
}
} catch (\Throwable $diagError) {
error_log("Error during Xdebug profile diagnostic check: " . $diagError->getMessage());
if ($clockwork) {
$clockwork->log()->error("Error during Xdebug profile diagnostic check: " . $diagError->getMessage());
}
} It prints:
Which matches the response headers in browser devtools:
It's needless to say that the file exists in both container and host filesystem:
Unfortunately the corresponding Clockwork JSON file of the same GET request has an empty xdebug array: {
"id": "1743373526-6852-1831031367",
"version": 1,
"type": "request",
"time": 1743373526.640225,
"method": "GET",
"url": "http://localhost/",
"uri": "/",
"headers": {
"Accept": [
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
],
"Accept-Encoding": [
"gzip, deflate, br, zstd"
],
"Accept-Language": [
"en-US,en;q=0.5"
],
"Connection": [
"keep-alive"
],
"Cookie": [
"categories=general; language=auto; locale=en; autocomplete=duckduckgo; favicon_resolver=; image_proxy=1; method=POST; safesearch=0; theme=simple; results_on_new_tab=1; doi_resolver=oadoi.org; simple_style=dark; center_alignment=0; advanced_search=0; query_in_title=0; infinite_scroll=1; search_on_category_select=1; hotkeys=default; url_formatting=pretty; disabled_engines=; enabled_engines=; disabled_plugins=; enabled_plugins=; tokens=; XDEBUG_PROFILE=1"
],
"Dnt": [
"1"
],
"Host": [
"localhost"
],
"Priority": [
"u=0, i"
],
"Referer": [
"http://localhost/"
],
"Sec-Fetch-Dest": [
"document"
],
"Sec-Fetch-Mode": [
"navigate"
],
"Sec-Fetch-Site": [
"same-origin"
],
"Sec-Fetch-User": [
"?1"
],
"Sec-Gpc": [
"1"
],
"Upgrade-Insecure-Requests": [
"1"
],
"User-Agent": [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0"
],
"X-Original-Host": [
"localhost"
]
},
"controller": null,
"getData": [],
"postData": [],
"requestData": "",
"sessionData": [],
"authenticatedUser": null,
"cookies": {
"categories": "general",
"language": "auto",
"locale": "en",
"autocomplete": "duckduckgo",
"favicon_resolver": "",
"image_proxy": "1",
"method": "POST",
"safesearch": "0",
"theme": "simple",
"results_on_new_tab": "1",
"doi_resolver": "oadoi.org",
"simple_style": "dark",
"center_alignment": "0",
"advanced_search": "0",
"query_in_title": "0",
"infinite_scroll": "1",
"search_on_category_select": "1",
"hotkeys": "default",
"url_formatting": "pretty",
"disabled_engines": "",
"enabled_engines": "",
"disabled_plugins": "",
"enabled_plugins": "",
"tokens": "",
"XDEBUG_PROFILE": "1"
},
"responseTime": 1743373526.723236,
"responseStatus": 200,
"responseDuration": 83.01115036010742,
"memoryUsage": 2097152,
"middleware": [],
"databaseQueries": [],
"databaseQueriesCount": 0,
"databaseSlowQueries": 0,
"databaseSelects": 0,
"databaseInserts": 0,
"databaseUpdates": 0,
"databaseDeletes": 0,
"databaseOthers": 0,
"databaseDuration": 0,
"cacheQueries": [],
"cacheReads": 0,
"cacheHits": 0,
"cacheWrites": 0,
"cacheDeletes": 0,
"cacheTime": 0,
"modelsActions": [],
"modelsRetrieved": [],
"modelsCreated": [],
"modelsUpdated": [],
"modelsDeleted": [],
"redisCommands": [],
"queueJobs": [],
"timelineData": [],
"log": [],
"events": [],
"routes": [],
"notifications": [],
"emailsData": [],
"viewsData": [],
"userData": [],
"httpRequests": [],
"subrequests": [],
"xdebug": [],
"commandName": null,
"commandArguments": [],
"commandArgumentsDefaults": [],
"commandOptions": [],
"commandOptionsDefaults": [],
"commandExitCode": null,
"commandOutput": null,
"jobName": null,
"jobDescription": null,
"jobStatus": null,
"jobPayload": [],
"jobQueue": null,
"jobConnection": null,
"jobOptions": [],
"testName": null,
"testStatus": null,
"testStatusMessage": null,
"testAsserts": [],
"clientMetrics": [],
"webVitals": [],
"parent": null,
"updateToken": "80099cdd"
} |
Hi!
I cannot get Clockwork to parse the profiles, as per title I get:
The Docker image I used is
dunglas/frankenphp:1.4.4-php8.4.5-alpine
php.ini
profile
and xdebug.start_with_requestyes
does not help either, FYI!Let's browse http://localhost/clockwork and run
curl -v "http://localhost/api/users/123?XDEBUG_PROFILE"
to see what gets logged:./logs/php/frankenphp/error.log
:Logger:
The curl request:
xdebug info:
Also why is xdebug spamming the
/tmp/xdebug-profiles
folder with so many generated GZ files? I understand it's because of the polling conducted by Clockwork but is there any way to prevent this kind of behavior? That seems to be garbage profiles to me.The text was updated successfully, but these errors were encountered: