Error in rbind(info, getNamespaceInfo(env, "S3methods"))

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in rbind(info, getNamespaceInfo(env, "S3methods"))

Matt Dowle
Dear all,

I'm experiencing an unusual installation error for one package. Could
anyone suggest how I can best investigate this from here please?  I'm sorry
this isn't very much to go on. Hopefully someone can point me in the right
direction.

The problem seems to be my library.  It is large (3,418 packages) and I'd
like to avoid rebuilding it, if possible.  All packages are up to date
according to update.packages().

The error is :
** byte-compile and prepare package for lazy loading
Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
  number of columns of matrices must match (see arg 2)
ERROR: lazy loading failed for package ‘staRdom’
* removing ‘/home/mdowle/build/revdeplib/staRdom’

This package (staRdom) has had a recent update but CRAN checks page is
showing OK, mostly:
https://cran.r-project.org/web/checks/check_results_staRdom.html.   The two
errors there don't seem to be related.

The package installs no problem when I don't include my revdeplib.  But
when I do include my revdeplib it fails with the error above.

I can reproduce as follows :

$ export R_LIBS=~/build/revdeplib/
$ R
> .libPaths()
[1] "/home/mdowle/build/revdeplib" "/usr/lib/R/library"
> install.packages("staRdom")
Installing package into ‘/home/mdowle/build/revdeplib’
(as ‘lib’ is unspecified)
trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz'
Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
==================================================
downloaded 2.5 MB
* installing *source* package ‘staRdom’ ...
** package ‘staRdom’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
  number of columns of matrices must match (see arg 2)
ERROR: lazy loading failed for package ‘staRdom’
* removing ‘/home/mdowle/build/revdeplib/staRdom’
The downloaded source packages are in
        ‘/tmp/RtmprvTDCg/downloaded_packages’
Warning message:
In install.packages("staRdom") :
  installation of package ‘staRdom’ had non-zero exit status
>
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
 [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
           LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2
>


If I don't include my revdeplib library,  it works fine :

$ R
> .libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
 "/usr/lib/R/library"
> install.packages("staRdom")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz'
Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

* installing *source* package ‘staRdom’ ...
** package ‘staRdom’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (staRdom)

The downloaded source packages are in
        ‘/tmp/RtmpmSiZLa/downloaded_packages’
>
> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
 [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
           LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2
>

I'm not sure how to debug this because both install.packages() and `R CMD
check` start a new instance of R. How do a get debugger() prompt at the
point of the error? All I can think of is inserting a browser() in my own
compile of R-devel. But that seems a big step. I thought I'd post here
first to see if anyone had any suggestions in how to proceed.

Thanks in advance,
Matt

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error in rbind(info, getNamespaceInfo(env, "S3methods"))

Duncan Murdoch-2
On 18/02/2019 4:08 p.m., Matt Dowle wrote:
> Dear all,
>
> I'm experiencing an unusual installation error for one package. Could
> anyone suggest how I can best investigate this from here please?  I'm sorry
> this isn't very much to go on. Hopefully someone can point me in the right
> direction.

When packages are installed, a hidden environment is created called
".__NAMESPACE__.".  It contains a number of objects; it looks as though
one of yours called "S3methods" is corrupted.  I can't guess whether it
is one coming from staRdom or one already in your library, but it
appears yours doesn't have the usual number of columns (which I think is 3).

So you could get a list of all packages in your library, and run

sapply(allpackages, function(x)
ncol(asNamespace(x)$.__NAMESPACE__.$S3methods))

to see which of them don't return 3 as the number of columns.  (This
will load all of them, so might need to be broken up into batches.)

Duncan Murdoch

>
> The problem seems to be my library.  It is large (3,418 packages) and I'd
> like to avoid rebuilding it, if possible.  All packages are up to date
> according to update.packages().
>
> The error is :
> ** byte-compile and prepare package for lazy loading
> Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
>    number of columns of matrices must match (see arg 2)
> ERROR: lazy loading failed for package ‘staRdom’
> * removing ‘/home/mdowle/build/revdeplib/staRdom’
>
> This package (staRdom) has had a recent update but CRAN checks page is
> showing OK, mostly:
> https://cran.r-project.org/web/checks/check_results_staRdom.html.   The two
> errors there don't seem to be related.
>
> The package installs no problem when I don't include my revdeplib.  But
> when I do include my revdeplib it fails with the error above.
>
> I can reproduce as follows :
>
> $ export R_LIBS=~/build/revdeplib/
> $ R
>> .libPaths()
> [1] "/home/mdowle/build/revdeplib" "/usr/lib/R/library"
>> install.packages("staRdom")
> Installing package into ‘/home/mdowle/build/revdeplib’
> (as ‘lib’ is unspecified)
> trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz'
> Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
> ==================================================
> downloaded 2.5 MB
> * installing *source* package ‘staRdom’ ...
> ** package ‘staRdom’ successfully unpacked and MD5 sums checked
> ** R
> ** data
> *** moving datasets to lazyload DB
> ** inst
> ** byte-compile and prepare package for lazy loading
> Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
>    number of columns of matrices must match (see arg 2)
> ERROR: lazy loading failed for package ‘staRdom’
> * removing ‘/home/mdowle/build/revdeplib/staRdom’
> The downloaded source packages are in
>          ‘/tmp/RtmprvTDCg/downloaded_packages’
> Warning message:
> In install.packages("staRdom") :
>    installation of package ‘staRdom’ had non-zero exit status
>>
>> sessionInfo()
> R version 3.5.2 (2018-12-20)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 18.04.2 LTS
>
> Matrix products: default
> BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
> LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>   LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>   LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> LC_PAPER=en_US.UTF-8
>   [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
>             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_3.5.2 tools_3.5.2
>>
>
>
> If I don't include my revdeplib library,  it works fine :
>
> $ R
>> .libPaths()
> [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
>   "/usr/lib/R/library"
>> install.packages("staRdom")
> Installing package into ‘/usr/local/lib/R/site-library’
> (as ‘lib’ is unspecified)
> trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz'
> Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
> ==================================================
> downloaded 2.5 MB
>
> * installing *source* package ‘staRdom’ ...
> ** package ‘staRdom’ successfully unpacked and MD5 sums checked
> ** R
> ** data
> *** moving datasets to lazyload DB
> ** inst
> ** byte-compile and prepare package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded
> * DONE (staRdom)
>
> The downloaded source packages are in
>          ‘/tmp/RtmpmSiZLa/downloaded_packages’
>>
>> sessionInfo()
> R version 3.5.2 (2018-12-20)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 18.04.2 LTS
>
> Matrix products: default
> BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
> LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
>
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>   LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>   LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> LC_PAPER=en_US.UTF-8
>   [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
>             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_3.5.2 tools_3.5.2
>>
>
> I'm not sure how to debug this because both install.packages() and `R CMD
> check` start a new instance of R. How do a get debugger() prompt at the
> point of the error? All I can think of is inserting a browser() in my own
> compile of R-devel. But that seems a big step. I thought I'd post here
> first to see if anyone had any suggestions in how to proceed.
>
> Thanks in advance,
> Matt
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Error in rbind(info, getNamespaceInfo(env, "S3methods"))

Matt Dowle
Thanks, Duncan.
I took the approach you suggested and eventually found it was due to
R.matlab (staRdom imports R.matlab).

> require(R.matlab)
Loading required package: R.matlab
Error: package or namespace load failed for ‘R.matlab’ in rbind(info,
getNamespaceInfo(env, "S3methods")):
 number of columns of matrices must match (see arg 2)
Warning message:
package ‘R.matlab’ was built under R version 3.6.0
> R.version.string
[1] "R version 3.5.2 (2018-12-20)"

At some point in the past I guess I used R-devel with this library and it
installed R.matlab using R-devel.

Reinstalling R.matlab did the trick and staRdom works fine now.
I checked that none of the other 2,643 packages in this library were built
using R>3.5.2.  It was just R.matlab.

Thanks for your help!
Best, Matt

On Mon, Feb 18, 2019 at 1:28 PM Duncan Murdoch <[hidden email]>
wrote:

> On 18/02/2019 4:08 p.m., Matt Dowle wrote:
> > Dear all,
> >
> > I'm experiencing an unusual installation error for one package. Could
> > anyone suggest how I can best investigate this from here please?  I'm
> sorry
> > this isn't very much to go on. Hopefully someone can point me in the
> right
> > direction.
>
> When packages are installed, a hidden environment is created called
> ".__NAMESPACE__.".  It contains a number of objects; it looks as though
> one of yours called "S3methods" is corrupted.  I can't guess whether it
> is one coming from staRdom or one already in your library, but it
> appears yours doesn't have the usual number of columns (which I think is
> 3).
>
> So you could get a list of all packages in your library, and run
>
> sapply(allpackages, function(x)
> ncol(asNamespace(x)$.__NAMESPACE__.$S3methods))
>
> to see which of them don't return 3 as the number of columns.  (This
> will load all of them, so might need to be broken up into batches.)
>
> Duncan Murdoch
>
> >
> > The problem seems to be my library.  It is large (3,418 packages) and I'd
> > like to avoid rebuilding it, if possible.  All packages are up to date
> > according to update.packages().
> >
> > The error is :
> > ** byte-compile and prepare package for lazy loading
> > Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
> >    number of columns of matrices must match (see arg 2)
> > ERROR: lazy loading failed for package ‘staRdom’
> > * removing ‘/home/mdowle/build/revdeplib/staRdom’
> >
> > This package (staRdom) has had a recent update but CRAN checks page is
> > showing OK, mostly:
> > https://cran.r-project.org/web/checks/check_results_staRdom.html.   The
> two
> > errors there don't seem to be related.
> >
> > The package installs no problem when I don't include my revdeplib.  But
> > when I do include my revdeplib it fails with the error above.
> >
> > I can reproduce as follows :
> >
> > $ export R_LIBS=~/build/revdeplib/
> > $ R
> >> .libPaths()
> > [1] "/home/mdowle/build/revdeplib" "/usr/lib/R/library"
> >> install.packages("staRdom")
> > Installing package into ‘/home/mdowle/build/revdeplib’
> > (as ‘lib’ is unspecified)
> > trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz
> '
> > Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
> > ==================================================
> > downloaded 2.5 MB
> > * installing *source* package ‘staRdom’ ...
> > ** package ‘staRdom’ successfully unpacked and MD5 sums checked
> > ** R
> > ** data
> > *** moving datasets to lazyload DB
> > ** inst
> > ** byte-compile and prepare package for lazy loading
> > Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
> >    number of columns of matrices must match (see arg 2)
> > ERROR: lazy loading failed for package ‘staRdom’
> > * removing ‘/home/mdowle/build/revdeplib/staRdom’
> > The downloaded source packages are in
> >          ‘/tmp/RtmprvTDCg/downloaded_packages’
> > Warning message:
> > In install.packages("staRdom") :
> >    installation of package ‘staRdom’ had non-zero exit status
> >>
> >> sessionInfo()
> > R version 3.5.2 (2018-12-20)
> > Platform: x86_64-pc-linux-gnu (64-bit)
> > Running under: Ubuntu 18.04.2 LTS
> >
> > Matrix products: default
> > BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
> > LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
> >
> > locale:
> >   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
> >   LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
> >   LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> > LC_PAPER=en_US.UTF-8
> >   [8] LC_NAME=C                  LC_ADDRESS=C
>  LC_TELEPHONE=C
> >             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] stats     graphics  grDevices utils     datasets  methods   base
> >
> > loaded via a namespace (and not attached):
> > [1] compiler_3.5.2 tools_3.5.2
> >>
> >
> >
> > If I don't include my revdeplib library,  it works fine :
> >
> > $ R
> >> .libPaths()
> > [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
> >   "/usr/lib/R/library"
> >> install.packages("staRdom")
> > Installing package into ‘/usr/local/lib/R/site-library’
> > (as ‘lib’ is unspecified)
> > trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz
> '
> > Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
> > ==================================================
> > downloaded 2.5 MB
> >
> > * installing *source* package ‘staRdom’ ...
> > ** package ‘staRdom’ successfully unpacked and MD5 sums checked
> > ** R
> > ** data
> > *** moving datasets to lazyload DB
> > ** inst
> > ** byte-compile and prepare package for lazy loading
> > ** help
> > *** installing help indices
> > ** building package indices
> > ** installing vignettes
> > ** testing if installed package can be loaded
> > * DONE (staRdom)
> >
> > The downloaded source packages are in
> >          ‘/tmp/RtmpmSiZLa/downloaded_packages’
> >>
> >> sessionInfo()
> > R version 3.5.2 (2018-12-20)
> > Platform: x86_64-pc-linux-gnu (64-bit)
> > Running under: Ubuntu 18.04.2 LTS
> >
> > Matrix products: default
> > BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
> > LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
> >
> > locale:
> >   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
> >   LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
> >   LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> > LC_PAPER=en_US.UTF-8
> >   [8] LC_NAME=C                  LC_ADDRESS=C
>  LC_TELEPHONE=C
> >             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] stats     graphics  grDevices utils     datasets  methods   base
> >
> > loaded via a namespace (and not attached):
> > [1] compiler_3.5.2 tools_3.5.2
> >>
> >
> > I'm not sure how to debug this because both install.packages() and `R CMD
> > check` start a new instance of R. How do a get debugger() prompt at the
> > point of the error? All I can think of is inserting a browser() in my own
> > compile of R-devel. But that seems a big step. I thought I'd post here
> > first to see if anyone had any suggestions in how to proceed.
> >
> > Thanks in advance,
> > Matt
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel