Skip to content
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

403/404 from update cache if mod.io mod deleted #126

Open
jieyouxu opened this issue Feb 2, 2024 · 9 comments
Open

403/404 from update cache if mod.io mod deleted #126

jieyouxu opened this issue Feb 2, 2024 · 9 comments
Assignees
Labels
A-cache Area: caching C-bug Category: bug, defects P-critical Priority: critical P-modio Provider: mod.io

Comments

@jieyouxu
Copy link
Collaborator

jieyouxu commented Feb 2, 2024

We have a bug in our caching logic that if a mod gets renamed/deleted/hidden on mod.io then the API endpoint will return 403/404 which prevents the cache from being updated, i.e. bricking mint. This is less than ideal, we should properly invalidate the relevant cache entries upon receiving such responses.

Current Workaround

  • Remove deleted/renamed mod from profiles
  • Delete the cache directory
@jieyouxu jieyouxu added the C-bug Category: bug, defects label Feb 2, 2024
@jieyouxu
Copy link
Collaborator Author

jieyouxu commented Feb 2, 2024

Also need to improve the error reporting when this situation does occur.

@LabManCam
Copy link

I have been running into this issue for the last several days and I'm wondering if it is an issue with a moved resource or something else, like a rate limit from Mod.io.
I quit out of the app and reload, attempt to update the cache again, and a different mod is throwing the error. Sometimes it is the 5th mod to try the update, other times its the 80th. Are the error messages indicating that the last request is what caused the error? Or is it being caused by a mod that isn't being put into the console? See the attached excerpt of all the different times that it errors with no access.
error logs.txt

@jieyouxu
Copy link
Collaborator Author

jieyouxu commented Feb 5, 2024

Are the error messages indicating that the last request is what caused the error? Or is it being caused by a mod that isn't being put into the console?

Note that the error message isn't particularly helpful here -- the last request might not necessarily be the one causing the 404 error (which is what I meant by the error message needing to be improved). Could you please send the mod list that triggers the 404 error?

@LabManCam
Copy link

I opened up each mod's page, by clicking on it from mod integration, and found that one of the mods had been deleted. After removing that mod, the 404's stopped. It looks like I was incorrect, but the error messages weren't helpful in identifying the issue.

@jieyouxu jieyouxu added P-modio Provider: mod.io A-cache Area: caching P-high Priority: high labels Mar 2, 2024
@jieyouxu
Copy link
Collaborator Author

jieyouxu commented Mar 5, 2024

how to find the mod causing the 404 error?

We improved the error reporting on master, which will tell you (in a future release) that
https://mod.io/g/drg/m/server-filter-by-region#3134718 was deleted.

ERROR mint::gui::message: failed to fetch mod files for <https://mod.io/g/drg/m/server-filter-by-region#3134718> (mod_id = 3134718): HTTP status client error (404 Not Found): The requested mod id could not be found.

@jieyouxu jieyouxu pinned this issue Mar 6, 2024
@jieyouxu jieyouxu changed the title If a mod.io mod from cache is deleted or renamed, user can get 404 when updating cache 404 from cache if mod.io mod deleted Mar 6, 2024
@jieyouxu jieyouxu changed the title 404 from cache if mod.io mod deleted 404 from update cache if mod.io mod deleted Mar 6, 2024
@jieyouxu jieyouxu added P-critical Priority: critical and removed P-high Priority: high labels Jun 16, 2024
@jieyouxu jieyouxu changed the title 404 from update cache if mod.io mod deleted 403/404 from update cache if mod.io mod deleted Jun 16, 2024
@jieyouxu jieyouxu self-assigned this Jun 17, 2024
@jieyouxu
Copy link
Collaborator Author

So for mod.io-specific caching, we basically need to treat mod.io as unreliable: mods and their transitive closure of dependencies can be renamed, yanked or hidden. We would need to devise a scheme that aims to maintains the integrity of the local cache in a way such that updating the cache can fail, but it should not block installing what's present in the cache. Failing to update the cache for any mod in particular also should not prevent other mods from being updated.

The core logic probably looks something like "a mod.io mod should only be updated iff mods in its transitive closure can be updated".

@almera-vs
Copy link

almera-vs commented Jul 13, 2024

Same problem here, after updating cache this error appeared:

←[31mERROR←[0m ←[2mdrg_mod_integration::gui::message←[0m←[2m:←[0m modio::Error {
    kind: Status(
        404,
    ),
    source: Error {
        code: 404,
        error_ref: 14000,
        message: "The requested mod id could not be found.",
        errors: None,
    },
}

I had to dig through the mod URLs to find out which mod was removed or hidden. In the end, removing the mod and updating the cache fixed the problem.

I would suggest a change to:

  1. automatically remove mods that were not found and display a warning within UI
  2. try updating cache again on the updated mod list

Another solution is moving these mods to a new directory where they wouldn't be launched or installed, but they would still be listed in the app.

@MrLint
Copy link

MrLint commented Jul 21, 2024

There seems to also be an issue that mod.io just will throw a 404 even for mods that exist. Perhaps there is a server side issue, or more rate limiting?

ERROR drg_mod_integration::gui::message: modio::Error {
kind: Status(
404,
),
source: Error {
code: 404,
error_ref: 15023,
message: "You do not have access to this resource.",
errors: None,
},
}

@ORLOX93
Copy link

ORLOX93 commented Jul 31, 2024

@MrLint i believe that message shows up with hidden mods. I have seen it before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cache Area: caching C-bug Category: bug, defects P-critical Priority: critical P-modio Provider: mod.io
Projects
None yet
Development

No branches or pull requests

5 participants