-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Achievements metrics shows (Unexpected Error) #1479
Comments
Same here.
This was thrown soo many times, probably because the auto-retry. I cancel the action execution after 7 min. |
I also see the issue: "Unexpected error" [
{
name: 'achievements',
result: {
error: {
message: 'Unexpected error',
instance: 'Failed to initiate total for achievement plugin'
}
}
}
] |
GitHub have added a home page to GitHub Search, so metrics can't get total repository/user/issue number from https://github.com/search. And the query string can't be empty, so maybe we can try searching for (let i = 0; (i < 100) && ((!total.users) || (!total.repositories)); i++) {
const page = await browser.newPage()
await page.goto("https://github.com/search?q=+created%3A%3E2007")
const totalres = await page.evaluate(() => [...[...document.querySelectorAll("h2")].filter(node => /Filter by/.test(node.innerText)).shift()?.nextSibling?.innerText.trim().matchAll(/(?<type>Repositories|Users|Issues)\n(?<count>.*?)M/g) ?? []]) ?? null
for (const result of totalres) {
const type = result[1]?.toLowerCase()
console.debug(`metrics/compute/plugins > achievements > setup found ${type ?? "(?)"}`)
const count = result[2] ?? ""
if ((count !== "") && (!total[type])) {
total[type] = Number(count) * 10e5
console.debug(`metrics/compute/plugins > achievements > set total.${type} to ${total[type]}`)
}
}
await page.close()
await imports.wait(10 * Math.random())
} |
can you explain please what I have to do to make it work? |
@X-itachi-X probably says to edit the http here |
Issue lowlighter#1479 - Update index.mjs
I have the same problem and disabling the workflow and then enabling it again does not work. The error in the action is as follows: Can someone see what's wrong here and explain this? detailsRendering │
1 error(s) occurred
[
Status │ complete
{
MIME type │ image/svg+xml
name: 'achievements',
result: {
────────────────────────────────────────────────────────────────────────────────────────
Saving │
Output condition │ always
Save to /metrics_renders/.github/src/metrics.plugin.achievements.compact.svg │ ok
Output action │ commit
error: {
message: 'Unexpected error',
instance: 'Failed to initiate total for achievement plugin'
}
}
}
]
Current render sha │ fa44788002fed81464296f2c6203928f8fd7648d
Commit to branch main │ (no changes)
|
Your question has been answered already, but you have to read the full contents of the issue. I will copy the direct link to make it easier for you to read. |
Thanks. But this means the problem is not on my side but with metrics? If yes, thank you for the fix in advance. |
It is more than line#85. |
I have tested and implemented your code, and it works as expected. Thank you for your contribution! |
Yes, you can view the complete changes in TonyCrane@46f3272. But seems this repo haven't updated for a few months, and my last pull request is ignored and closed by robot, so I haven't open a PR for this (also I don't think my solution is the best). But I think we should repair this? So what do you think @lowlighter ? |
@TonyCrane I tested your patch locally and it works as expected. I think the workaround is good enough for now so I merged it into master 👍 I guess now we could use the Search API directly by passing your query into it and be more reliable and faster, instead of using puppeteer as it could break again in a future redesign |
This issue is closed and it looks like a PR has been merged solving this issue... |
After this pr is merged, there is no new release, so |
Includes a fix for "unexpected error" in metrics: lowlighter/metrics#1479
Fixes the achievements "Unexpected Error" lowlighter/metrics#1479 Downside: Instead of using a @stable I needed to move into @master temporarily
Discussed in #1478
Originally posted by orsnaro July 11, 2023

metrics code in my
metrics_action.yml
The text was updated successfully, but these errors were encountered: