Open salsa2k opened 1 year ago
403 is the http error code saying "Forbidden" as in you're currently not allowed to download this file. With Github this typically happens if you're above your request limit. Maybe you restarted the server too often which ran the update check a bunch of times? I'll look into the "getting stuck" part, that obviously shouldn't happen just because the API returns an error.
I totally confirm it would be a great idea @lloesche Alternatively, we could use a personal access token through an environment variable to poll Github as an authenticated user ? Rate limit increases from 60 to 5000 as an authenticated user https://www.endorlabs.com/blog/how-to-get-the-most-out-of-github-api-rate-limits
I am getting a 403 when trying to download Valheim Plus on a first time server start. How would I add github personal access token to a docker-compose?
I am getting a 403 when trying to download Valheim Plus on a first time server start. How would I add github personal access token to a docker-compose?
I did it by using a command in the hooks and changing the content of the valheim-plus-updater
script:
Set POST_BOOTSTRAP_HOOK
to sed -i '/$VALHEIM_PLUS_RELEASE"/c\ if ! api_response=$(curl -sfSL "https://api.github.com/repos/$VALHEIM_PLUS_REPO/releases/$VALHEIM_PLUS_RELEASE" --header "Authorization: Bearer $GITHUB_ACCESS_TOKEN"); then' /usr/local/bin/valheim-plus-updater
I then added a new environment variable GITHUB_ACCESS_TOKEN
to the compose file and set the token there.
Some more linux savy people might find errors in my sed
command or have improvements...
Currently it's useless anyways, since valheim-plus is broken with the latest update appearantly.
Oct 4 23:39:36 supervisord: valheim-server ArgumentException: Undefined target method for patch method static System.Collections.Generic.IEnumerable<HarmonyLib.CodeInstruction> ValheimPlus.SE_Rested_GetNearbyPieces_Transpiler::Transpiler(System.Collections.Generic.IEnumerable<HarmonyLib.CodeInstruction> instructions)
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.PatchClassProcessor.PatchWithAttributes (System.Reflection.MethodBase& lastOriginal) [0x00047] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.PatchClassProcessor.Patch () [0x0006a] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server Rethrow as HarmonyException: Patching exception in method null
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) [0x0006c] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.PatchClassProcessor.Patch () [0x00095] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.Harmony.<PatchAll>b__11_0 (System.Type type) [0x00007] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) [0x00014] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) [0x00006] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server at HarmonyLib.Harmony.PatchAll () [0x0001b] in <474744d65d8e460fa08cd5fd82b5d65f>:0
Oct 4 23:39:36 supervisord: valheim-server at ValheimPlus.ValheimPlusPlugin.Awake () [0x00048] in <7c2de1882abc413da7273413f1d1b902>:0
Hey, sometimes when I have to restart my container, I'm getting 403 and the server gets stuck. Sometimes I have to wait 30 minutes, sometimes I have to wait 1 hour or even more.
I saw in another post someone mentioning that the API have a limit, but how come I'm reaching this limit, if I restarted the server once in the past 5 hours?
Here is my log:
And my docker-compose config:
Thanks ;)