You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "xxping (via GitHub)" <gi...@apache.org> on 2023/03/09 03:04:30 UTC

[GitHub] [skywalking] xxping opened a new issue, #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

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

   ### 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
   
   php agent log show 
   ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))
   how to fix it
   
   ### What you expected to happen
   
   php agent log show 
   ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))
   how to fix it
   
   ### How to reproduce
   
   php agent log show 
   ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))
   how to fix it
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### 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: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] jmjoy commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "jmjoy (via GitHub)" <gi...@apache.org>.
jmjoy commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1469604955

   > I think the problem may not be the code. I put the project in the K8S cluster, and through ingress-nginx access, I found that there is no SW8 key in http header. Could it be caused by ingress-nginx?
   
   Maybe not.


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng closed issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))
URL: https://github.com/apache/skywalking/issues/10517


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] jmjoy commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "jmjoy (via GitHub)" <gi...@apache.org>.
jmjoy commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1635169182

   Please try latest version.


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1463482342

   /**
    * 并行处理进程
    * @param array $aMergeData [['uri'=>'', 'body'=>[]]] 需要发送的数组对象
    * @param int $iTimeout 指定超时时间 0 表示不超时
    * @return false | [['pkg'=>'', 'cls'=>'', 'sent'=>'', 'receive'=>'', 'http_code'=>0,'curl_error'=>'', 'runtime'=>0],]
    */
   private function _transmissionMerge(array $aMergeData, int $iTimeout=0){
   	$sTraceId = $this->getTraceId();
   
   	$iStart = microtime(true); //记录通信开始时间
   	$aCurlTask = [];
   	//创建批量curl对象
   	foreach ($aMergeData as & $aNode){
   		$sData = json_encode($aNode['body'], JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT); //json编码
   		$sUri = $aNode['uri'];
   
   		$aRunInfo = ['pkg'=>$aNode['body']['package'], 'cls'=>$aNode['body']['class'],
   			'sent'=>$sData, 'receive'=>'', 'http_code'=>0,'curl_error'=>'',
   			'runtime'=>0,'ch'=>curl_init(), 'ch_code'=>null
   		]; //初始化
   		$aRunInfo['ch_code'] = strval($aRunInfo['ch']); //资源ID序列化
   		$aHeader = array();
   		if (!empty($_SERVER['HTTP_SW8'])){ //skywalking 网关跟踪字段继续往后抛
   			$aHeader[] = 'SW8: '. $_SERVER['HTTP_SW8'];
   			$sUri .= '?_r='.$aNode['body']['package'] .'.'. $aNode['body']['class']; //此处仅为skywalying透传路由,无其他用处
   		}
   		$aHeader[] = 'Connection: close';
   		$aHeader[] = 'Content-Type: application/json; charset=utf-8';
   		$aHeader[] = 'Content-length: '. strlen($sData);
   		$aHeader[] = 'Cache-Control: no-cache';
   		$aHeader[] = 'Trace-Id: '. $sTraceId;
   		$aHeader[] = 'Expect:';
   		curl_setopt($aRunInfo['ch'],CURLOPT_URL, $sUri); //接口地址
   		curl_setopt($aRunInfo['ch'], CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); //强制协议为1.0
   		curl_setopt($aRunInfo['ch'], CURLOPT_HTTPHEADER, $aHeader);//设置header
   		curl_setopt($aRunInfo['ch'], CURLOPT_USERAGENT, $this->_sClientName);
   		curl_setopt($aRunInfo['ch'], CURLOPT_RETURNTRANSFER, true);//将结果保存成字符串
   		curl_setopt($aRunInfo['ch'], CURLOPT_POST, true);//post提交方式
   		curl_setopt($aRunInfo['ch'], CURLOPT_ENCODING ,'gzip'); //加入gzip解析
   		curl_setopt($aRunInfo['ch'], CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); //php版本5.3及以上,可关闭IPV6,只使用IPV4
   		curl_setopt($aRunInfo['ch'], CURLOPT_CONNECTTIMEOUT, 2 ); //php版本5.2.3及以上,连接超时时间(秒)
   		if ($iTimeout > 0){
   			curl_setopt($aRunInfo['ch'], CURLOPT_TIMEOUT, $iTimeout ); //运行超时(秒)
   		}else{
   			curl_setopt($aRunInfo['ch'], CURLOPT_TIMEOUT, self::API_RESPONSE_TIMEOUT ); //运行超时(秒)
   		}
   		curl_setopt($aRunInfo['ch'], CURLOPT_POSTFIELDS, $sData); //送出post数据
   		curl_setopt($aRunInfo['ch'], CURLOPT_HEADER, true); //获取头信息
   		$aCurlTask[] = $aRunInfo;
   		unset($aRunInfo);
   	}
   	unset($aNode);
   	//创建批处理句柄
   	$mh = curl_multi_init(); //1 创建批处理cURL句柄
   	foreach ($aCurlTask as & $aNode){
   		curl_multi_add_handle($mh, $aNode['ch']); // 增加句柄
   	}
   	unset($aNode);
   	//循环等待处理结果
   	$iActive = 0;
   	do {
   		while (($mrc = curl_multi_exec($mh, $iActive)) == CURLM_CALL_MULTI_PERFORM) ; //开始执行curl
   		if ($mrc != CURLM_OK) {
   			break;
   		} //全部完成结束循环
   		// 找到一个已经完成的请求
   		while (($done = curl_multi_info_read($mh)) !== false) {
   			// get the info and content returned on the request
   			$aCurlInfo = curl_getinfo($done['handle']);//获取状态信息
   			$sError = curl_error($done['handle']);//获取失败信息
   			$sResult = curl_multi_getcontent($done['handle']);
   			$sResult = substr($sResult, strpos($sResult, "\r\n\r\n")+4); //保存最后一次收到的数据
   			$sCH_CODE = strval($done['handle']);
   			// 移除已经完成的句柄
   			curl_multi_remove_handle($mh, $done['handle']);
   			curl_close($done['handle']);
   			unset($done['handle']);
   
   			//将结果集合并回数组
   			foreach ($aCurlTask as & $aNode){
   				if (isset($aNode['ch_code']) && $aNode['ch_code'] === $sCH_CODE){ //找到资源项,塞回数据
   					$aNode['receive'] = $sResult;
   					$aNode['curl_error'] = $sError;
   					$aNode['runtime'] = intval($aCurlInfo['total_time']*1000);
   					$aNode['http_code'] = $aCurlInfo['http_code'];
   					unset($aNode['ch'], $aNode['ch_code']);
   					break;
   				}
   			}
   			unset($aNode);
   		}
   		// Block for data in / output; error handling is done by curl_multi_exec
   		if ($iActive > 0) {
   			curl_multi_select($mh); //阻塞,等待请求返回
   		}
   	} while ($iActive);
   	curl_multi_close($mh); //关闭句柄
   	unset($mh);
   
   	return $aCurlTask;
   }
   
   
   it‘s curl code here. Thank you!
   
   
   
   
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461238848

   I searched for similar questions. It seems to only appear in version 0.2, but my version is 0.3.0


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461198978

   0.3.0 version


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461205964

   my config
   /etc/php/7.4/fpm/php.ini
   ![image](https://user-images.githubusercontent.com/11566855/223907273-dea08b6f-1caa-4fdb-bc73-e09c1cf6a436.png)
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461208203

    and the error log is
   ![image](https://user-images.githubusercontent.com/11566855/223907812-4a5801ad-6dab-4729-aebe-7b1dd95b4429.png)
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1463485658

   [curl_php.txt](https://github.com/apache/skywalking/files/10940327/curl_php.txt)
   
   It's curl code


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461223388

   what demo?sorry I don't understand. 
   I just integrated the agent into my php project.and the  config is the above description,then the error show " ERROR shutdown: skywalking_agent::channel: channel send failed err=No such file or directory (os error 2)"


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461858108

   In the open-source, if you need some help, provide demo codes and steps to help on reproducing the error.
   Otherwise, it is not worth to take maintainers so much time to guess.


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] jmjoy commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "jmjoy (via GitHub)" <gi...@apache.org>.
jmjoy commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1467859128

   > [curl_php.txt](https://github.com/apache/skywalking/files/10940327/curl_php.txt)
   > 
   > It's curl code @wu-sheng @jmjoy
   
   This code failed to reproduce the issue.


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1469590972

   > > [curl_php.txt](https://github.com/apache/skywalking/files/10940327/curl_php.txt)
   > > It's curl code @wu-sheng @jmjoy
   > 
   > This code failed to reproduce the issue.
   
   
   I think the problem may not be the code. I put the project in the K8S cluster, and through ingress-nginx access, I found that there is no SW8 key in http header. Could it be caused by ingress-nginx?


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] jmjoy commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "jmjoy (via GitHub)" <gi...@apache.org>.
jmjoy commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461202503

   Code ?


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] jmjoy commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "jmjoy (via GitHub)" <gi...@apache.org>.
jmjoy commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461217394

   Please write a demo to reproduce the error, otherwise I can't fix it.
   
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] xxping commented on issue #10517: [Bug] ERROR skywalking_agent::execute: before execute ex err=PHPer(ExpectType(ExpectTypeError { expect_type: TypeInfo { t: 4 }, actual_type: TypeInfo { t: 262 } }))

Posted by "xxping (via GitHub)" <gi...@apache.org>.
xxping commented on issue #10517:
URL: https://github.com/apache/skywalking/issues/10517#issuecomment-1461612538

   Hello. Can you give me some help? 


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org