caiyi3857200 opened a new issue, #13139:
URL: https://github.com/apache/skywalking/issues/13139

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   PHP (apache/skywalking-php)
   
   ### What happened
   
   The skywalking_agent extension automatically deletes its Unix socket file 
shortly after initialization, resulting in subsequent reporting errors:
   
   2025-03-25T02:21:23.147083Z INFO: Remove socket file 
"/tmp/skywalking-agent/631216082cef2.sock"
   2025-03-25T02:22:34.186745Z ERROR: Channel send failed - No such file or 
directory (os error 2)
   
   Key Observations:
   
   The socket file is created and then immediately removed by the agent's 
shutdown hook
   
   This behavior occurs with both:
   
   skywalking_agent 0.8.0 (Kafka reporter)
   
   skywalking_agent 0.7.0 (gRPC reporter)
   
   Works correctly in PHP 7.4.33 environments
   
   
   New issue specific to PHP 8.0.26
   
   Both gRPC and Kafka reporters exhibit the same error
   
   The same setup (PHP 7.4.33 + skywalking_agent 0.7.0) has been working 
normally for over 1 year in other projects
   
   The issue appears specifically with PHP 8.0+ requirements in new projects
   
   ### What you expected to happen
   
   Preventing premature shutdown in PHP 8.0's execution model
   Alternative IPC approaches that survive PHP 8's lifecycle changes
   Required patches for PHP 8 compatibility
   
   ### How to reproduce
   
   Environment:
   
   OS: CentOS 8
   
   PHP: 8.0.26
   
   PHP Extensions Installed: bcmath, Core, ctype, curl, date, dom, filter, ftp, 
gd, gettext, grpc, hash, iconv, igbinary, intl, json, libxml, mbstring, mysqli, 
mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, 
protobuf, rdkafka, redis, Reflection, session, shmop, SimpleXML, 
skywalking_agent, soap, sockets, sodium, SPL, sqlite3, standard, sysvsem, 
tokenizer, xml, xmlreader, xmlwriter, zip, zlib
   
   System Dependencies:
   
   GCC: 8.5.0 (Red Hat 8.5.0-4)
   
   LLVM: 12.0.1
   
   Clang: 12.0.1 (Red Hat 12.0.1-4.module_el8.5.0+1025+93159d6c)
   
   Installation Method: PECL
   
   With skywalking_agent 0.8.0:
   skywalking_agent
   
   version => 1.0.0-dev
   authors => Apache Software Foundation:jmjoy <[email protected]>:Yanlong He 
<[email protected]>
   
   Directive => Local Value => Master Value
   skywalking_agent.enable => 1 => 1
   skywalking_agent.skywalking_version => 9 => 9
   skywalking_agent.server_addr => 127.0.0.1:11800 => 127.0.0.1:11800
   skywalking_agent.instance_name => no value => no value
   skywalking_agent.service_name => dcm_shop_system_prod => dcm_shop_system_prod
   skywalking_agent.worker_threads => 0 => 0
   skywalking_agent.log_level => DEBUG => DEBUG
   skywalking_agent.log_file => /tmp/skywalking-agent.log => 
/tmp/skywalking-agent.log
   skywalking_agent.runtime_dir => /tmp/skywalking-agent => 
/tmp/skywalking-agent
   skywalking_agent.authentication => no value => no value
   skywalking_agent.enable_tls => 0 => 0
   skywalking_agent.ssl_trusted_ca_path => no value => no value
   skywalking_agent.ssl_key_path => no value => no value
   skywalking_agent.ssl_cert_chain_path => no value => no value
   skywalking_agent.heartbeat_period => 30 => 30
   skywalking_agent.properties_report_period_factor => 10 => 10
   skywalking_agent.enable_zend_observer => 0 => 0
   skywalking_agent.reporter_type => kafka => kafka
   skywalking_agent.kafka_bootstrap_servers => 172.16.54.73:9092 => 
172.16.54.73:9092
   skywalking_agent.kafka_producer_config => {} => {}
   skywalking_agent.inject_context => 0 => 0
   skywalking_agent.standalone_socket_path => no value => no value
   skywalking_agent.psr_logging_level => no value => no value
   
   Error Log:
   2025-03-24T19:01:40.51969029+08:00 INFO: Remove socket file 
socket_file="/tmp/skywalking-agent/63114875ecb9e.sock"
   2025-03-24T19:03:48.724125628+08:00 ERROR: channel send failed err=No such 
file or directory (os error 2)
   
   With skywalking_agent 0.7.0:
   skywalking_agent
   
   version => 0.7.0
   authors => Apache Software Foundation:jmjoy <[email protected]>:Yanlong He 
<[email protected]>
   
   Directive => Local Value => Master Value
   skywalking_agent.enable => 1 => 1
   skywalking_agent.skywalking_version => 9 => 9
   skywalking_agent.server_addr => 172.16.53.42:11800 => 172.16.53.42:11800
   skywalking_agent.service_name => dcm_shop_system_prod => dcm_shop_system_prod
   skywalking_agent.worker_threads => 0 => 0
   skywalking_agent.log_level => DEBUG => DEBUG
   skywalking_agent.log_file => /tmp/skywalking-agent.log => 
/tmp/skywalking-agent.log
   skywalking_agent.runtime_dir => /tmp/skywalking-agent => 
/tmp/skywalking-agent
   skywalking_agent.authentication => no value => no value
   skywalking_agent.enable_tls => 0 => 0
   skywalking_agent.ssl_trusted_ca_path => no value => no value
   skywalking_agent.ssl_key_path => no value => no value
   skywalking_agent.ssl_cert_chain_path => no value => no value
   skywalking_agent.heartbeat_period => 30 => 30
   skywalking_agent.properties_report_period_factor => 10 => 10
   skywalking_agent.enable_zend_observer => 0 => 0
   skywalking_agent.reporter_type => grpc => grpc
   skywalking_agent.kafka_bootstrap_servers => no value => no value
   skywalking_agent.kafka_producer_config => {} => {}
   2025-03-25T02:21:23.147083Z INFO: Remove socket file 
socket_file="/tmp/skywalking-agent/631216082cef2.sock"
   2025-03-25T02:22:34.186745Z ERROR: channel send failed err=No such file or 
directory (os error 2)
   
   ### Anything else
   
   Please help investigate:
   
   Why the agent's shutdown hook triggers prematurely in PHP 8.0
   
   How to maintain persistent socket connection in PHP 8 environments
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to