You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not able to view the emualtor on the web browser #1453
With the current level of details, it's hard to understand what's going on.
It appears that a HTTP 401 is returned — indicating some authentication issues. (it's plausible that some auth headers were not properly passed to the server, and hence the error.)
Can you first try talking to an endpoint that does not require authentication and ensure the basic flow works, and then turn on authentication and debug the auth issue? That might help you isolate the issue.
We are able to print the token below:
if (isSignedIn) {
firebase.auth().currentUser.getIdToken().then(function (token) {
auth.setToken(Bearer ${token}); console.log("Token in authHeader:", token);
});
}
/**
Called by the EmulatorWebClient to obtain the authentication
@hridhar Hihi. Thanks for providing all the details!
I've noticed that in your request header, you have the following auth header:
Authorization : Bearer "TOKEN KEY"
I suppose a proper token was provide above? And yet you're still seeing invalid token error?
Could you try the same request with curl? If you're getting a server 401, and if you are seeing the same error when using curl command, then it's outside of the scope of the grpc-web client library, but rather there's something you need to fix with your server / auth setup.
We have checked the Token and it is valid token.
Header: Verified the algorithm (alg) used for signing.
Payload: Confirmed the content, including expiration (exp), issuer (iss), and any other claims.
Signature: Sign the token.
Please find the below information and please let me know for the more information.
We are running below commands inside emulator_emulator:latest container. Command : curl -I http://docker_front-envoy_1:8080/android.emulation.control.EmulatorController/getStatus Output :
HTTP/1.1 404 Not Found
Cache-Control: no-cache
X-XSS-Protection: 1
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Content-Length: 3688
Pragma: no-cache
Thanks for providing the above info, although it seems that the auth headers are missing from the logs.
I was earlier suggesting that you use "curl" with all the same request headers which you had passed in the grpc-web request.
You could do that by using the "copy as curl" function in Chrome's network tab.
The primary point being, if this request is failing due to auth issue, it can be caused by any number of reasons, and you should try identifying what exactly is causing it, because you can know if this is a server, client issue, or a combination of both.
Just now I have tried, running the working curl command inside the emulator_envoy:latest container.
We don't see anything error or output or empty space/line. Just it will go to the next prompt (output is same as above).
Also at this point i don't believe this qualifies as a grpc-web "issue", but rather a discussion thread — with regards to fixing auth in your server integration. I'll convert it as one :)
Activity
sampajano commentedon Jul 24, 2024
@hridhar thanks for reaching out!
With the current level of details, it's hard to understand what's going on.
It appears that a HTTP 401 is returned — indicating some authentication issues. (it's plausible that some auth headers were not properly passed to the server, and hence the error.)
Can you first try talking to an endpoint that does not require authentication and ensure the basic flow works, and then turn on authentication and debug the auth issue? That might help you isolate the issue.
hridhar commentedon Jul 25, 2024
Hi,
Thanks for the reply,
Please find the below information.
We are able to list the services using below command.
grpcurl -plaintext localhost:8554 list
We are using the below scripts to run the emulator over container.
https://github.com/google/android-emulator-container-scripts
We are fallowing below steps.
Expected Result:
8.Emulator should run without any issue over web browser.
Point your browser to localhost.
Actual Result:
8. Not able to view the emulator on the web browser.
Error Facing:
We are able to print the token also.
Below is the trace logs.
POST http://localhost:8080/android.emulation.control.EmulatorController/sendMouse 401 (Unauthorized)
Ot @ index.js:42
Yt @ index.js:63
(anonymous) @ index.js:57
Kt.X @ index.js:57
(anonymous) @ emulator_web_client.js:68
i.android.emulation.control.EmulatorControllerClient.sendMouse @ emulator_controller_grpc_web_pb.js:742
value @ jsep_protocol_driver.js:351
(anonymous) @ event_handler.js:101
gi @ react-dom.production.min.js:131
ys @ react-dom.production.min.js:220
Pl @ react-dom.production.min.js:259
t.unstable_runWithPriority @ scheduler.production.min.js:18
Go @ react-dom.production.min.js:122
xl @ react-dom.production.min.js:252
vl @ react-dom.production.min.js:243
(anonymous) @ react-dom.production.min.js:123
t.unstable_runWithPriority @ scheduler.production.min.js:18
Go @ react-dom.production.min.js:122
qo @ react-dom.production.min.js:123
Yo @ react-dom.production.min.js:122
ke @ react-dom.production.min.js:292
(anonymous) @ react-dom.production.min.js:50
Nr @ react-dom.production.min.js:105
Jt @ react-dom.production.min.js:75
Xt @ react-dom.production.min.js:74
t.unstable_runWithPriority @ scheduler.production.min.js:18
$t @ react-dom.production.min.js:73
emulator_web_client.js:94 low level gRPC error: {"message":"Http response at 400 or 500 level, http status code: 401","stack":"Error: Http response at 400 or 500 level, http status code: 401\n at new k (http://localhost/static/js/main.9d8095e4.js:2:742097)\n at Gt (http://localhost/static/js/main.9d8095e4.js:2:765119)\n at Ct. (http://localhost/static/js/main.9d8095e4.js:2:764803)\n at ze (http://localhost/static/js/main.9d8095e4.js:2:751021)\n at Ve (http://localhost/static/js/main.9d8095e4.js:2:750827)\n at xt (http://localhost/static/js/main.9d8095e4.js:2:758352)\n at Pt (http://localhost/static/js/main.9d8095e4.js:2:759133)\n at r.W (http://localhost/static/js/main.9d8095e4.js:2:760075)\n at r.R (http://localhost/static/js/main.9d8095e4.js:2:760054)","code":16,"metadata":{}}
We have tried opening http://localhost:8080/android.emulation.control.EmulatorController/sendMouse over the web browser.
Getting below error:
Jwt is missing
Below is the response header:
Access-Control-Allow-Origin : http://localhost
Access-Control-Expose-Headers : custom-header-1,grpc-status,grpc-message
Connection : close
Content-Length : 0
Content-Type : application/grpc-web-text+proto
Date : Wed, 24 Jul 2024 13:49:36 GMT
Grpc-Message : Jwks remote fetch is failed
Grpc-Status : 16
Server : envoy
Www-Authenticate : Bearer realm="http://localhost:8080/android.emulation.control.EmulatorController/getStatus", error="invalid_token"
Below is the request header:
Accept : application/grpc-web-text
Accept-Encoding : gzip, deflate, br, zstd
Accept-Language : en-US,en;q=0.9
Authorization : Bearer "TOKEN KEY"
Connection : keep-alive
Content-Length : 8
Content-Type : application/grpc-web-text
Dnt : 1
Host : localhost:8080
Origin : http://localhost
Referer : http://localhost/
Sec-Ch-Ua : "Not/A)Brand";v="8", "Chromium";v="126", "Microsoft Edge";v="126"
Sec-Ch-Ua-Mobile : ?0
Sec-Ch-Ua-Platform : "Linux"
Sec-Fetch-Dest : empty
Sec-Fetch-Mode : cors
Sec-Fetch-Site : same-site
User-Agent : Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
X-Grpc-Web : 1
X-User-Agent : grpc-web-javascript/0.1
General Information:
Request URL : http://localhost:8080/android.emulation.control.EmulatorController/getStatus
Request Method : POST
Status Code : 401 Unauthorized
Remote Address : [::1]:8080
Referrer Policy : strict-origin-when-cross-origin
We are able to print the token below:
if (isSignedIn) {
firebase.auth().currentUser.getIdToken().then(function (token) {
auth.setToken(
Bearer ${token});console.log("Token in authHeader:", token);
});
}
/**
*/
authHeader = () => {
console.log("Token in authHeader:", this.token );
return { Authorization: this.token };
};
}
Please let me know if you need some more information.
Thank for the support, much appreciated.
hridhar commentedon Jul 25, 2024
Hi @sampajano
We are getting below error while opening the web browser.
![Uploading Screenshot from 2024-07-09 14-00-15.png…]()
sampajano commentedon Jul 25, 2024
@hridhar Hihi. Thanks for providing all the details!
I've noticed that in your request header, you have the following auth header:
I suppose a proper token was provide above? And yet you're still seeing invalid token error?
Could you try the same request with
curl? If you're getting a server 401, and if you are seeing the same error when usingcurlcommand, then it's outside of the scope of the grpc-web client library, but rather there's something you need to fix with your server / auth setup.hridhar commentedon Jul 26, 2024
Hi @sampajano,
Thanks for the help and support.
We have checked the Token and it is valid token.
Header: Verified the algorithm (alg) used for signing.
Payload: Confirmed the content, including expiration (exp), issuer (iss), and any other claims.
Signature: Sign the token.
Please find the below information and please let me know for the more information.
Command : curl -I http://docker_front-envoy_1:8080/android.emulation.control.EmulatorController/getStatus
Output :
HTTP/1.1 404 Not Found
Cache-Control: no-cache
X-XSS-Protection: 1
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Content-Length: 3688
Pragma: no-cache
Command : curl -I http://emulator_service_grpc:8554/android.emulation.control.EmulatorController/getStatus
Output :
HTTP/1.1 404 Not Found
Cache-Control: no-cache
X-XSS-Protection: 1
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Content-Length: 3697
Pragma: no-cache
Command : curl -I http://docker_front-envoy_1:8080/android.emulation.control.Rtc
Output :
HTTP/1.1 404 Not Found
Cache-Control: no-cache
X-XSS-Protection: 1
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Content-Length: 3664
Pragma: no-cache
Command : curl -I http://host.docker.internal:8080
Output :
HTTP/1.1 404 Not Found
Cache-Control: no-cache
X-XSS-Protection: 1
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Content-Length: 3635
Pragma: no-cache
Command : curl -I http://localhost:8554/android.emulation.control.EmulatorController/getStatus
Output :
curl: (1) Received HTTP/0.9 when not allowed
Command : curl http://localhost:8554
Output :
curl: (1) Received HTTP/0.9 when not allowed
Command : grpcurl -plaintext localhost:8554 list android.emulation.control.Rtc
Output :
android.emulation.control.Rtc.receiveJsepMessage
android.emulation.control.Rtc.receiveJsepMessages
android.emulation.control.Rtc.requestRtcStream
android.emulation.control.Rtc.sendJsepMessage
Command : curl -I http://localhost:8080/android.emulation.control.EmulatorController/getStatus
Output :
HTTP/1.1 401 Unauthorized
www-authenticate: Bearer realm="http://localhost:8080/android.emulation.control.EmulatorController/getStatus"
content-length: 14
content-type: text/plain
date: Fri, 26 Jul 2024 11:00:26 GMT
server: envoy
hridhar commentedon Jul 26, 2024
Hi @sampajano,
Please find below logs taken from the emulator_envoy:latest.
Line 32406: �front-envoy_1 |� [2024-07-26T09:22:30.183Z] "OPTIONS /android.emulation.control.EmulatorController/setGps HTTP/1.1" 200 - 0 0 25 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "806f3bf6-436c-430a-8f10-874220a40be2" "localhost:8080" "-"
Line 32407: �front-envoy_1 |� [2024-07-26T09:22:30.182Z] "OPTIONS /android.emulation.control.EmulatorController/getStatus HTTP/1.1" 200 - 0 0 26 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "804351eb-e58f-4f5f-a1d8-a4481bcb5315" "localhost:8080" "-"
Line 32474: �front-envoy_1 |� [2024-07-26T09:22:30.209Z] "OPTIONS /android.emulation.control.Rtc/requestRtcStream HTTP/1.1" 200 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "f4ae0d8f-c6c9-4acf-a260-a3d7e15e4add" "localhost:8080" "-"
Line 32475: �front-envoy_1 |� [2024-07-26T09:22:30.211Z] "POST /android.emulation.control.EmulatorController/getStatus HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "b0a31837-19aa-4c31-8e04-976526e68e41" "localhost:8080" "-"
Line 32476: �front-envoy_1 |� [2024-07-26T09:22:30.211Z] "POST /android.emulation.control.EmulatorController/setGps HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "33e42be7-a390-4293-a064-7493d04ba478" "localhost:8080" "-"
Line 32477: �front-envoy_1 |� [2024-07-26T09:22:30.212Z] "POST /android.emulation.control.Rtc/requestRtcStream HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "426b6135-f7bf-4a6a-b138-348c62214472" "localhost:8080" "-"
Line 32478: �front-envoy_1 |� [2024-07-26T09:22:30.297Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "26849c45-e93f-406a-a6e0-0aa1b41b45f9" "localhost:8080" "-"
Line 32479: �front-envoy_1 |� [2024-07-26T09:22:30.477Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "a6abe818-fe67-4ff8-8785-18b09a10b612" "localhost:8080" "-"
Line 32480: �front-envoy_1 |� [2024-07-26T09:22:31.184Z] "OPTIONS /android.emulation.control.EmulatorController/getLogcat HTTP/1.1" 200 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "fe61aec1-61fa-4f33-8c43-b36d730fc00d" "localhost:8080" "-"
Line 32481: �front-envoy_1 |� [2024-07-26T09:22:31.185Z] "POST /android.emulation.control.EmulatorController/getLogcat HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "7a1a4339-faea-4bfa-af94-17d7bf6e5784" "localhost:8080" "-"
Line 32482: �front-envoy_1 |� [2024-07-26T09:22:31.210Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "bf7f9854-b298-4128-bfab-46ce7c9ef7b1" "localhost:8080" "-"
Line 32632: �front-envoy_1 |� [2024-07-26T09:22:37.891Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "8a4f8e94-0365-4fea-85e7-01f1621dc65f" "localhost:8080" "-"
Line 36222: �front-envoy_1 |� [2024-07-26T09:27:36.400Z] "GET / HTTP/1.1" 304 - 0 0 0 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "3b945fc1-7783-4e51-87a6-d842016a4c09" "localhost:8080" "172.20.0.3:80"
Line 36223: �front-envoy_1 |� [2024-07-26T09:27:36.420Z] "GET /static/css/main.4c7bd351.css HTTP/1.1" 304 - 0 0 0 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "2bf6b779-4acc-4def-945e-9b8d775f166a" "localhost:8080" "172.20.0.3:80"
Line 36355: �front-envoy_1 |� [2024-07-26T09:27:36.422Z] "GET /static/js/main.9d8095e4.js HTTP/1.1" 200 - 0 1087581 63 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "b351ce1f-6908-4ce3-a519-36f5c0718bc4" "localhost:8080" "172.20.0.3:80"
Line 36356: �front-envoy_1 |� [2024-07-26T09:27:36.563Z] "GET /manifest.json HTTP/1.1" 304 - 0 0 0 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "74e8b1c4-f8c7-451f-b567-b9922cbe7116" "localhost:8080" "172.20.0.3:80"
Line 36357: �front-envoy_1 |� [2024-07-26T09:27:36.583Z] "GET /static/css/main.4c7bd351.css.map HTTP/1.1" 304 - 0 0 0 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "34d1d80b-f5ed-4003-b214-a667c8c37b50" "localhost:8080" "172.20.0.3:80"
Line 36358: �front-envoy_1 |� [2024-07-26T09:27:36.644Z] "GET /static/js/main.9d8095e4.js.map HTTP/1.1" 200 - 0 5400526 4 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "c205c9e5-a742-492c-9028-370b10d4a04e" "localhost:8080" "172.20.0.3:80"
Line 36359: �front-envoy_1 |� [2024-07-26T09:27:38.137Z] "POST /android.emulation.control.EmulatorController/getStatus HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "acb11ca2-0fa0-4770-bf17-029ce7a6093c" "localhost:8080" "-"
Line 36360: �front-envoy_1 |� [2024-07-26T09:27:38.139Z] "POST /android.emulation.control.EmulatorController/setGps HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "2dc9f946-58ab-4fce-b0d3-16aaa58b7c5f" "localhost:8080" "-"
Line 36361: �front-envoy_1 |� [2024-07-26T09:27:38.140Z] "POST /android.emulation.control.Rtc/requestRtcStream HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "9dc3bba4-bdc0-45d1-a434-bbaca3e779fb" "localhost:8080" "-"
Line 36362: �front-envoy_1 |� [2024-07-26T09:27:39.143Z] "POST /android.emulation.control.EmulatorController/getLogcat HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "972f2170-b8d0-4e48-9313-6386024b1026" "localhost:8080" "-"
Line 36363: �front-envoy_1 |� [2024-07-26T09:27:39.752Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "ede615d9-42d8-4047-85d1-b8daabaa4e46" "localhost:8080" "-"
Line 36364: �front-envoy_1 |� [2024-07-26T09:27:41.232Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "9fb6af28-5ba4-47e4-9987-6a5768a6c7e1" "localhost:8080" "-"
Line 36494: �front-envoy_1 |� [2024-07-26T09:27:46.434Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "f5a06daa-00e9-4fe3-8b4e-7f7f2ed0f5e8" "localhost:8080" "-"
Line 36495: �front-envoy_1 |� [2024-07-26T09:27:46.713Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "6f527a20-951f-4d16-8f92-8ff0304cbc4a" "localhost:8080" "-"
Line 36496: �front-envoy_1 |� [2024-07-26T09:27:48.211Z] "POST /android.emulation.control.EmulatorController/getStatus HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "7d6b7b57-1326-4edd-aebf-7a35c184e8ec" "localhost:8080" "-"
Line 36497: �front-envoy_1 |� [2024-07-26T09:27:48.212Z] "POST /android.emulation.control.EmulatorController/setGps HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "c89f2c0e-75c0-4043-ba8e-519561ecadbc" "localhost:8080" "-"
Line 36498: �front-envoy_1 |� [2024-07-26T09:27:48.218Z] "POST /android.emulation.control.Rtc/requestRtcStream HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "8150a190-a9b1-41a8-844a-4a10e8937311" "localhost:8080" "-"
Line 36499: �front-envoy_1 |� [2024-07-26T09:27:49.218Z] "POST /android.emulation.control.EmulatorController/getLogcat HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "85765202-6b46-4ce8-a07c-b15be7756646" "localhost:8080" "-"
Line 39045: �front-envoy_1 |� [2024-07-26T09:31:24.858Z] "HEAD / HTTP/1.1" 200 - 0 0 1 0 "-" "curl/7.81.0" "7bf7f73c-c521-4497-b169-37887835acc6" "localhost:8080" "172.20.0.3:80"
Line 42873: �front-envoy_1 |� [2024-07-26 09:36:36.402][9][info][main] [source/server/drain_manager_impl.cc:175] shutting down parent after drain
Line 102824: �front-envoy_1 |� [2024-07-26T10:58:30.078Z] "OPTIONS /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 200 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "062a8d35-1fdd-40ac-b192-324bf330c237" "localhost:8080" "-"
Line 102825: �front-envoy_1 |� [2024-07-26T10:58:30.082Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "363bef9d-e9e0-4f07-81da-9fa2586d05af" "localhost:8080" "-"
Line 104237: �front-envoy_1 |� [2024-07-26T11:00:26.880Z] "HEAD /android.emulation.control.EmulatorController/getStatus HTTP/1.1" 401 - 0 0 0 - "-" "curl/7.68.0" "d8066178-cf30-4ea6-b4b3-b55ecfbf50e2" "localhost:8080" "-"
Line 104876: �front-envoy_1 |� [2024-07-26T11:01:09.010Z] "POST /android.emulation.control.EmulatorController/sendMouse HTTP/1.1" 401 - 0 0 0 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0" "300a8700-93b7-4cf8-a0de-569998c046f9" "localhost:8080" "-"
sampajano commentedon Jul 26, 2024
@hridhar Hi :)
Thanks for providing the above info, although it seems that the auth headers are missing from the logs.
I was earlier suggesting that you use "curl" with all the same request headers which you had passed in the grpc-web request.
You could do that by using the "copy as curl" function in Chrome's network tab.
The primary point being, if this request is failing due to auth issue, it can be caused by any number of reasons, and you should try identifying what exactly is causing it, because you can know if this is a server, client issue, or a combination of both.
hridhar commentedon Jul 26, 2024
Hi @sampajano,
Thank you for explaining and I got your point.
Thank you for your precious time.
Please find below info, and I am surprised that there is no output/error we observed while running the below command.
We are running below commands inside emulator_envoy:latest container.
Command : curl 'http://localhost:8080/android.emulation.control.EmulatorController/getStatus'
-H 'Accept: application/grpc-web-text'
-H 'Accept-Language: en-US,en;q=0.9'
-H 'Authorization: Bearer TOKEN_KEY'
-H 'Connection: keep-alive'
-H 'Content-Type: application/grpc-web-text'
-H 'Origin: http://localhost:8080'
-H 'Referer: http://localhost:8080/'
-H 'Sec-Fetch-Dest: empty'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Site: same-origin'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'
-H 'X-Grpc-Web: 1'
-H 'X-User-Agent: grpc-web-javascript/0.1'
-H 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "Linux"'
--data-raw 'AAAAAAA='> > >
Output : "we don't see anything error or output or empty space/line. Just it will go to the next prompt"
hridhar commentedon Jul 26, 2024
Hi @sampajano,
Just now I have tried, running the working curl command inside the emulator_envoy:latest container.
We don't see anything error or output or empty space/line. Just it will go to the next prompt (output is same as above).
sampajano commentedon Jul 27, 2024
@hridhar Hihi. i think you have some formatting issue wrt your curl command. (e.g. what's the >>> in the end?)
Try the following format maybe:
sampajano commentedon Jul 27, 2024
Also at this point i don't believe this qualifies as a grpc-web "issue", but rather a discussion thread — with regards to fixing auth in your server integration. I'll convert it as one :)