Hello R-devel, I hope that you are all doing well and that this is the right place to discuss my somewhat mysterious issue with S4. On our Ubuntu server, we have "mirt" package installed which defines S4 method for "coef" standard generic. We updated the package with the usual "install.packages", restarted, and observer error calling coef on mirt object that should not be possible: "Error in which: argument "nfact" is missing, with no default" (which has no such argument). After days of investigation, I found that from mirt 1.37 to current 1.40, the method changed as well as some internal functions used by the method. The aforementioned error stems from the fact that these internal ordinary functions were changed properly as we updated the package, but the S4 method dispatched stuck with the 1.37 version. I am by no means an expert on S4 matter, but I know that these are cached to some extent. I thought the cache is session-bound and have no idea how the issue can possibly persist even after a complete reboot of the machine. I can detach and library() mirt in one R session which solves the issue temporarily, but emerges right back in any new R session. Sadly, I cannot provide any reproducible example as I am completely unaware of the cause and even I cannot reproduce this issue outside of the server. Any insights on how this issue could have started would be highly appreciated. Best regards, Jan Net?k [[alternative HTML version deleted]]
Simon Urbanek
2023-Oct-02 18:56 UTC
[Rd] After package update, old S4 method is dispatched
Jan, have you re-installed all packages? If you change (update) any package that uses S4 it may be necessary to re-install all its reverse-dependencies as well since they may include cached values in their namespaces, so the easiest is to make sure you re-install all packages. Cheers, Simon> On Oct 3, 2023, at 4:18 AM, Jan Net?k <netikja at gmail.com> wrote: > > Hello R-devel, > > I hope that you are all doing well and that this is the right place to > discuss my somewhat mysterious issue with S4. > > On our Ubuntu server, we have "mirt" package installed which defines S4 > method for "coef" standard generic. We updated the package with the usual > "install.packages", restarted, and observer error calling coef on mirt > object that should not be possible: "Error in which: argument "nfact" is > missing, with no default" (which has no such argument). > > After days of investigation, I found that from mirt 1.37 to current 1.40, > the method changed as well as some internal functions used by the method. > The aforementioned error stems from the fact that these internal ordinary > functions were changed properly as we updated the package, but the S4 > method dispatched stuck with the 1.37 version. I am by no means an expert > on S4 matter, but I know that these are cached to some extent. I thought > the cache is session-bound and have no idea how the issue can possibly > persist even after a complete reboot of the machine. I can detach and > library() mirt in one R session which solves the issue temporarily, but > emerges right back in any new R session. > > Sadly, I cannot provide any reproducible example as I am completely unaware > of the cause and even I cannot reproduce this issue outside of the server. > > Any insights on how this issue could have started would be highly > appreciated. > > Best regards, > Jan Net?k > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >