HicServices / RDMP

Research Data Management Platform (RDMP) is an open source application for the loading,linking,anonymisation and extraction of datasets stored in relational databases.
https://github.com/HicServices/RDMP#research-data-management-platform
GNU General Public License v3.0
36 stars 16 forks source link

`Access to the path 'HIC.Rdmp.HicPlugin.Plugin.6.1.6.rdmp' is denied` when read-only #1882

Open rkm opened 1 month ago

rkm commented 1 month ago

Describe the bug

Permissions errors are raised when running RDMP CLI on a read-only installation.

It is desirable to make software packages read-only when deploying to some environments. I assumed the *.rdmp files were static data, but write access is expected.

To Reproduce

  1. Download the RDMP CLI v8.2.0
  2. Unpack and make read-only
  3. Run ./rdmp --dir ../yamlrepo

Expected behavior

The CLI executes as normal.

Screenshots

N/A.

RDMP Version

v8.2.0

Error with Stack Trace

> ./rdmp --dir ../yamlrepo/
2024-07-15 10:21:55.4823 INFO Dotnet Version:8.0.6 .
2024-07-15 10:21:55.5136 INFO RDMP Version:8.2.0.0 .
2024-07-15 10:21:55.7443 ERROR Access to the path '/home/rkm/tmp/rdmp-8.2.0-cli-linux/HIC.Rdmp.HicPlugin.Plugin.6.1.6.rdmp' is denied. .
2024-07-15 10:21:55.7443 INFO Fatal error occurred so returning -1 . System.UnauthorizedAccessException: Access to the path '/home/rkm/tmp/rdmp-8.2.0-cli-linux/HIC.Rdmp.HicPlugin.Plugin.6.1.6.rdmp' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at Rdmp.Core.Curation.Data.LoadModuleAssembly.HandlePluginVersioning() in D:\a\RDMP\RDMP\Rdmp.Core\Curation\Data\LoadModuleAssembly.cs:line 55
   at Rdmp.Core.Curation.Data.LoadModuleAssembly.PluginFiles() in D:\a\RDMP\RDMP\Rdmp.Core\Curation\Data\LoadModuleAssembly.cs:line 124
   at Rdmp.Core.Startup.Startup.LoadMEF(ICatalogueRepository catalogueRepository, ICheckNotifier notifier) in D:\a\RDMP\RDMP\Rdmp.Core\Startup\Startup.cs:line 245
   at Rdmp.Core.Startup.Startup.DoStartup(ICheckNotifier notifier) in D:\a\RDMP\RDMP\Rdmp.Core\Startup\Startup.cs:line 119
   at Rdmp.Core.CommandLine.Options.RDMPCommandLineOptions.DoStartup(ICheckNotifier checkNotifier) in D:\a\RDMP\RDMP\Rdmp.Core\CommandLine\Options\RDMPCommandLineOptions.cs:line 91
   at Rdmp.Core.CommandLine.RdmpCommandLineBootStrapper.Run(RDMPCommandLineOptions opts, IRunner explicitRunner, IRDMPPlatformRepositoryServiceLocator existingLocator) in D:\a\RDMP\RDMP\Rdmp.Core\CommandLine\RdmpCommandLineBootStrapper.cs:line 159
   at Rdmp.Core.Program.HandleArguments(String[] args, Logger logger) in D:\a\RDMP\RDMP\Tools\rdmp\Program.cs:line 83

Database Engine

N/A.

Additional context

N/A.

JFriel commented 1 month ago

Looks like the .rdmp plugin handler is opening the files with read/write permissions. We can get this fixed for v8.2.1