Versions:All
Summary:
This article provides information on ways to clear one type of "Permission denied" "Error in unzip" error from TERR Tools when installing CRAN packages on a personal computer.
Details:
You may encounter a file permissions issue with TIBCO Enterprise Runtime for R (TERR) on the local Spotfire desktop client, with an error like this one:
---------------------------
Error installing package:
Error in unzip(zipFile): error calling zip command
error: cannot delete old ./glue/libs/x64/glue.dll
Permission denied
---------------------------
(In this example, the name of the package is "glue", but this error can be thrown while trying to install any optional R or TERR package that uses a *.dll file.)
This error usually means the following:
(1) a version of that package is already installed in the library path for CRAN packages used by the TERR version your Spotfire desktop client is using, and
(2) another TERR session on the same machine has loaded the existing installed package into working memory for use by that other session.
That puts a lock on the package's existing DLL file (such as "glue.dll", for example), which prevents replacing that file.
(The process that installs the package needs to replace that file, even if the same version of the package is being installed.)
Resolution:
To get past this, you need to do the following:
(1) Close all Spotfire desktop client sessions, all TERR Console sessions, and all RStudio/TERR sessions on that machine.
(2) Open a brand new Spotfire desktop client session.
(3) Try installing that package again, using the "Tools > TERR Tools > Package Management" tab.
If you still receive the same "Permission denied" error after doing this, do the following:
(1) Launch a new TERR engine console session, using the Spotfire desktop client's "Tools > TERR Tools > Launch TERR Console" menu selection.
(2) In the TERR Console window this opens, paste the following (case sensitive) command, then press the <Enter> key:
normalizePath(.libPaths()[1])
That will display the user-specific library path where TERR Tools installs CRAN packages such as "glue".
The following TERR Console session shows an example of what that command returns:
=====
TIBCO Software Inc. Confidential Information
Copyright (C) 2011-2021 TIBCO Software Inc. ALL RIGHTS RESERVED
TIBCO Enterprise Runtime for R version 6.0.0 for Microsoft Windows 64-bit
Type 'help()' for help.
Type 'q()' to quit.
>
>
> normalizePath(.libPaths()[1])
[1] "C:\\Users\\MyUserID\\Documents\\TERR\\x86_64-w64-mingw32-library\\6.0"
>
>
=====
After replacing "\\" with "\", the following is the equivalent (example) path that can be pasted into the path field in Windows Explorer:
C:\Users\MyUserID\Documents\TERR\x86_64-w64-mingw32-library\6.0
Your Windows user account needs to have Windows permissions to make changes to package folders that are in this library path.
You can also try the following steps (while you still have no other TERR sessions open on the same machine):
(1) Use Windows Explorer to manually delete that package's folder (such as the "glue" folder, in this example) from the library path, then
(2) Use the Spotfire desktop client's "TERR Tools" feature to install the same package.
=========================
Important note on use of CRAN packages:
User-contributed R packages from the open-source R community's CRAN repository (https://cran.r-project.org/) are available under separate open source software license terms and are not part of the TIBCO Spotfire product line. As such, user-contributed CRAN packages are not within the scope of your license for any TIBCO Spotfire product. User-contributed CRAN packages are not supported, maintained, or warranted in any way by TIBCO Software Inc. Download and use of CRAN packages is solely at your own discretion and subject to the free open source license terms applicable to each individual package.
=========================