green-coding-solutions / eco-ci-energy-estimation

Eco CI Energy estimation for Github Actions Runner VMs
MIT License
48 stars 10 forks source link

Failed API requests #50

Closed ArneTR closed 7 months ago

ArneTR commented 7 months ago

I have a couple of these requests in our error logs. They seem to have originated over the workshop.

Can you tell why they happened? I guess they did nut query this URL manually, but there is some error with Eco-CI. But just a guess atm.

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 0_o >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   Error:
   Error in API call

   URL: http://api.green-coding.berlin/v1/ci/measurement/get?repo=code-schreiber%2FMyFancyFlutterApp&branch=master&workflow=77198454

   Query-Params: repo=code-schreiber%2FMyFancyFlutterApp&branch=master&workflow=77198454

   Client: None

   Headers: Headers({'host': 'api.green-coding.berlin', 'x-real-ip': '172.26.0.1', 'x-forwarded-for': '140.82.115.109, 172.26.0.1', 'x-forwarded-proto': 'http', 'connection': 'close', 'accept-encoding': 'gzip', 'cf-ray': '82b168fab9f62432-IAD', 'cf-visitor': '{"scheme":"https"}', 'user-agent': 'github-camo (8fae9ed4)', 'accept': 'image/avif,image/webp,*/*', 'accept-language': 'en-US,en;q=0.5', 'via': 'HTTP/1.1 github-camo (8fae9ed4)', 'cdn-loop': 'cloudflare', 'cf-connecting-ip': '140.82.115.109', 'cf-ipcountry': 'US'})

   Body: StarletteHTTPException handler cannot read body atm. Waiting for FastAPI upgrade.

   Optional details: Not Found

   Exception:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 0_o >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   Traceback (most recent call last):

File "/var/www/startup/venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/var/www/startup/venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call raise e File "/var/www/startup/venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call await self.app(scope, receive, send) File "/var/www/startup/venv/lib/python3.11/site-packages/starlette/routing.py", line 747, in call await self.default(scope, receive, send) File "/var/www/startup/venv/lib/python3.11/site-packages/starlette/routing.py", line 635, in not_found raise HTTPException(status_code=404) starlette.exceptions.HTTPException

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 0_o >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-- https://metrics.green-coding.berlin/

ArneTR commented 7 months ago

Next:

   Error:
   Error in API call

   URL: http://api.green-coding.berlin/v1/ci/measurement/get?repo=code-schreiber%2FMyFancyFlutterApp

   Query-Params: repo=code-schreiber%2FMyFancyFlutterApp

   Client: None

   Headers: Headers({'host': 'api.green-coding.berlin', 'x-real-ip': '172.26.0.1', 'x-forwarded-for': '62.214.9.98, 172.26.0.1', 'x-forwarded-proto': 'http', 'connection': 'close', 'accept-encoding': 'gzip', 'cf-ray': '82b16822fda0901f-FRA', 'cf-visitor': '{"scheme":"https"}', 'priority': 'u=1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8', 'accept-language': 'en-US,en;q=0.5', 'dnt': '1', 'upgrade-insecure-requests': '1', 'sec-fetch-dest': 'document', 'sec-fetch-mode': 'navigate', 'sec-fetch-site': 'none', 'sec-fetch-user': '?1', 'cdn-loop': 'cloudflare', 'cf-connecting-ip': '62.214.9.98', 'cf-ipcountry': 'DE'})

   Body: StarletteHTTPException handler cannot read body atm. Waiting for FastAPI upgrade.

   Optional details: Not Found

   Exception:
ArneTR commented 7 months ago

Next: Error: Error in API call

   URL: http://api.green-coding.berlin/v1/ci/measurement/get?repo=code-schreiber%2FMyFancyFlutterApp&branch=master&workflow=77198454

   Query-Params: repo=code-schreiber%2FMyFancyFlutterApp&branch=master&workflow=77198454

   Client: None

   Headers: Headers({'host': 'api.green-coding.berlin', 'x-real-ip': '172.26.0.1', 'x-forwarded-for': '62.214.9.98, 172.26.0.1', 'x-forwarded-proto': 'http', 'connection': 'close', 'accept-encoding': 'gzip', 'cf-ray': '82b167b84f9a901f-FRA', 'cf-visitor': '{"scheme":"https"}', 'priority': 'u=1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8', 'accept-language': 'en-US,en;q=0.5', 'dnt': '1', 'upgrade-insecure-requests': '1', 'sec-fetch-dest': 'document', 'sec-fetch-mode': 'navigate', 'sec-fetch-site': 'none', 'sec-fetch-user': '?1', 'cdn-loop': 'cloudflare', 'cf-connecting-ip': '62.214.9.98', 'cf-ipcountry': 'DE'})

   Body: StarletteHTTPException handler cannot read body atm. Waiting for FastAPI upgrade.

   Optional details: Not Found

   Exception:
ArneTR commented 7 months ago

It actually looks like somebody is iterating over URLs and adding params by hand ...?

dan-mm commented 7 months ago

I checked out the repository/workflow associated with these errors, and I think I've figured out where these came from exactly.

This was used by a workflow where Eco-CI is set up correctly, but the run itself fails (tests do not pass). That means the summary page at the end of the run doesn't show up, which includes the link to the front end.

Since these front end calls are all half-formed calls from our Eco-CI front end - I think someone at the workshop was just trying to access their front end by figuring out the URL manually.

So no real "error" here - but two improvements I can see is 1- post the metrics URL page in the github actions log, in case the summary is not available (though the log is a very overcrowded place and I'm not sure how many people will really check there)

2- figure out a simpler URL for people to follow

ArneTR commented 7 months ago

closing since investigated and considered non-bug