-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Lots of issues with tinytex complaining about tlmgr being out of date and not being able to find and install packages #436
Comments
This might be because TeXLive 2024 is about to come out https://tug.org/texlive/ |
Could be, but it has been going on for at least a few days already... |
This is usually when the CTAN mirror used is outdated compared to the local version you have installed. Did your mirror changed recently ? Sometimes there could be issue and some mirrors could be not synced correctly. See https://ctan.org/mirrors/mirmon This is unfortunate but this could happen
It seems this is the one used currently. You can change with
Is this
Could be too! We are in the period where there will be a day or two with possible broken install and broken CTAN mirror that are yet to be sync up with TeX Live 2024. |
I have never touched the mirror used by
> tinytex::tlmgr_repo()
tlmgr option repository
Default package repository (repository): https://mirror.ctan.org/systems/texlive/tlnet
I have only one
This sounds like the likely explanation. It seems there should be a cleaner way to do this... |
So this is the redirection mirror - See https://ctan.org/mirrors/
So this will redirect to nearest mirror - this could change from time to time maybe. I do think the fact your ended up with a outdated mirror was bad timing - or current problem / slowness on mirror syncing. Not sure we can do something about it in TinyTeX. You can configure your repo to another one you think is more reliable.
This is really odd behavior. We do run Lines 114 to 115 in 54eb1fd
Lines 118 to 121 in 54eb1fd
TeX Live does update often so it requires updating regularly, but I don't recall for it to be every minute. @yihui did you encounter some behavior as described by @dmkaplan2000 ? Do you have experience of something that would explain it ? |
To be absolutely clear about the behavior, sometimes when I execute |
I think you should try setup another mirror as your default config. It seems the redirection will send you quite often to a mirror that is not yet synced. |
That's my guess too. CTAN's default choice of mirrors can be problematic because the choice is random to some degree (i.e., the "fastest" mirror is not a fixed one). You could end up using different mirrors each time you call I have been aware of this problem for a few years now. I just thought more about it, and I think it may be a good idea to pin the CTAN repo after TinyTeX installation. FWIW, I have done that only for CI servers (such as Github Action runners) in ca4a834. The tricky thing is to decide which CTAN repo to use. One option is CTAN's automatic redirect: # in R
curlGetHeaders('https://mirror.ctan.org/systems/texlive/tlnet') # in shell
curl -I https://mirror.ctan.org/systems/texlive/tlnet But this repo could be older than the repo that we use to build TinyTeX, i.e., the Illinois mirror: tinytex/.github/workflows/build.yaml Line 38 in 54eb1fd
Then users will be in the same trouble (remote older than local). I think it may be still worth doing, though. If the problem arises, at least it will arise consistently... |
@dmkaplan2000 For now, I think the workaround for you is to find a mirror that looks up-to-date at https://ctan.org/mirrors/mirmon, right-click on the URL to copy it, and paste the URL to |
Thanks, that explains a lot - I didn't understand their system of randomly selecting a mirror. I will set the mirror as you suggest. |
Would always using the mirror that |
That's what I did for a while in the past. I don't remember clearly why I stopped doing so, but there are a few possible reasons:
The ideal solution is a CTAN mirror based on CDN (like the RStudio/Posit CRAN mirror), and let CDN take care of routing globally, instead of letting mirror.ctan.org choose a physical server. Some years ago, I actually asked RStudio about the possibility of hosting CTAN on CDN (precisely because of this problem), but it didn't work out. Oh wait, stupid me. I have actually implemented the idea mentioned in my previous reply via 626949f two years ago! I have totally forgotten it... Thanks to this thread, I just discovered two subtle bugs there upon a close inspection. I also discovered that actually there do exist CDN mirrors, such as https://www.matthewthom.as/mirrors/ Then I feel it may be possible default to a certain CDN mirror that looks reliable enough. |
All mirrors based on CloudFlare: x = readLines('https://ctan.org/mirrors/mirmon')
urls = xfun::grep_sub('.*<TD ALIGN=RIGHT><A HREF="(https://[^"]+)".*', '\\1', x)
s = unlist(lapply(urls, function(u) {
h = tryCatch(curlGetHeaders(u), error = function(e) character())
h = tolower(tail(grep('^server: ', h, value = TRUE, ignore.case = TRUE), 1))
if (length(h)) h else NA
}))
cat(urls[grep('cloudflare', s)], sep = '\n') https://eu.mirrors.cicku.me/ctan/ I'm a little hesitant to default to any of these mirrors since they seem to be backed by individual contributors. If there were a .edu mirror based on CloudFlare, I'd be more confident to make it the default. Anyway, I have fixed the bugs in the default selection of mirrors. TinyTeX installed via remotes::install_github('rstudio/tinytex') |
@yihui do you think that would be useful to provide a helper function to get a list of these if someone is willing to set manually to one of them ? We would set by default, but we could provide helpers to help set to one of them 🤷 Maybe the fix is enough though - good catch !! Thanks for asking and reporting @dmkaplan2000 ! Your contributions are always relevant and very welcome ! Thanks ! |
@cderv that is a really nice thing to say. Sometimes it is hard to find the time and energy to file a proper bug report, so it is nice to see that it is worth something. |
@cderv I added
@dmkaplan2000 Yes, it definitely requires time and energy to file a good bug report. We really appreciate your effort! |
@yihui If you have any issues with my mirror, feel free to reach out and clarify. I handle TB/PB levels of traffic everyday for many projects. |
- Add a ctan mirror list (source info from rstudio/tinytex#436) - Add install_texlive() method - Add logic to try install latex with a lot mirrors with install_texlive() method
I have tried clean installs of tinytex on two different machines running Ubuntu 20 and 22 and I have had lots of issues with tinytex not being able to install necessary ctan packages, with it complaining that the tlmgr remote database is out of date and then it not being able to find and install the necessary ctan packages even though I am able to do so from the command line (though sometimes requiring multiple attempts to update tlmgr). An example of the error messages is copied below and I put the standard debugging info at the end of this report.
R commands to reproduce my error are:
Example output of the knit process is:
Here it complains about not being able to find
anyfontsize.sty
, but if I go to the shell and execute:It works just fine. Doing this I can slowly walk my way through all the CTAN dependencies, but my understanding is that tinytex is supposed to figure this out all by itself...
The debugging info (for the Ubuntu 20 machine; the newer Ubuntu 22 machine is elsewhere) is:
By filing an issue to this repo, I promise that
xfun::session_info('tinytex')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/tinytex')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: