Jenkins Master - Docker Slave: Build shows error - docker

Using Master on Windows VM whereas tried to spin container in linux container. Kindly help to resolve this.
Even some idea/ guidance would be of great help.
hudson.remoting.ChannelBuilder withJarCacheOrDefault WARNING: Could not
create jar cache. Running
without cache.
java.io.IOException:Failed to initialize the default JAR Cache location
Caused by: java.nio.file.AccessDeniedException: /home/jenkins/? \
Caused by: java.lang.IllegalArgumentException: Root directory not
writable: ?/.jenkins/cache/jars

Looks like permission issue.
Does the Windows VM has write permission for the Linux Container?
Caused by: java.nio.file.AccessDeniedException: /home/jenkins/? \
Caused by: java.lang.IllegalArgumentException: Root directory not writable: ?/.jenkins/cache/jars
In Linux Container did you verified above path exists or not?

Related

Installing Cygwin in Windows Docker container

An attempt to install Cygwin in an Docker container on Windows fails with the error:
re-exec error: exit status 1: output: time="2020-12-11T15:00:26+01:00" level=error msg="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" error="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" importFolderPath="D:\\docker\\tmp\\hcs678884955" path="\\\\?\\D:\\docker\\windowsfilter\\9b956fcbc6cf19ba2f18fe39e12639da939e14916f019a32541df16e7dbf5b1e"
hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)
At https://github.com/microsoft/hcsshim/issues/835, they write that hardlinks are the reason for the problem. Zipping/unzipping the CygWin folder should help fix it but, using Cygwin installer, you have no control over the unattended installation.
Is there any other method for how Cygwin can be installed in a Docker container?
Is it possible to suppress the creation of hardlinks by Cygwin installer?
This is caused by the fact that cygwin is using hard links that seems cause docker to fail, try to install cygwin locally, then zip & unzip into the separate folder, they simply add cygwin using ADD

How to build/run container with writable file system using Singularity 3?

I am using Singularity 3.0 and trying to pull a container image from DockerHub and run it on a university cluster. I followed this recipe to get started.
singularity pull --name rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2
singularity exec --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787
The container process starts but when I try to connect via a browser I get the following error log.
01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: rstudio::core::FilePath rstudio::core::system::userSettingsPath(const rstudio::core::FilePath&, const string&) /home/ubuntu/rstudio/src/cpp/core/system/PosixSystem.cpp:486
01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:1689
Seems that the file system in the container is only read-only. How do I build (or run) the container such that the container's file system is writable?
Update:
I was able to get the RStudio Server running on the university cluster as follows.
singularity exec --home my-project-directory rstudio-3.5.2.sif rserver --www-port 8787
This seems to work because Singularity automatically mounts the user's home directory on the host into the container and I redefined my home directory to be my-project-directory in the above.
However I still cannot install R packages into the container as the file system is not writable.
> install.packages(c("plyr", "dply", "tidyr", "ggplot2"))
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) cancel
Error in install.packages : unable to install packages
Original question still stands: how can I create a Singularity 3.* container that has a writable filesystem? If this is not possible, explanation as to why would be appreciated.
Reading in this article, apparently there is a solution to the problem concerning package installation:
Create an .Renviron file in your home directory and set R_LIBS_USER as follows:
# User-installed R packages go into their home directory
echo 'R_LIBS_USER=~/R/%p-library/%v' >> ${HOME}/.Renviron
This solved the package-installation-issue for me.
try --writable flag in your container:
singularity build --writable rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2
singularity exec --writable --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787
You can create a sandbox folder with --sandbox option .
Also you probably can create a Virtual Machine / vagrant for singularity 2.5

is /usr/bin/ authorized as a default location for volume sharing in docker prefrences?

I am sharing a docker-compose file with a team member to easily build our app. We're both on OSX and it works fine from my machine, but my colleague is getting the following error:
ERROR: for backend Cannot start service backend: b'Mounts denied: \r\nThe path /usr/bin/docker\r\nis not shared from OS X and is not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.'
I assume it is due to the following statement in the docker-compose.yaml.
volumes:
- "/usr/bin/docker:/usr/bin/docker"
I didn't have to alter my docker-> preferences-> file sharing to make this work. I only have the default dirs shared: /Users, /Volumes, /tmp, /private.
How come it isn't working on his machine? Does he have to add the /usr dir as a shared dir? If so, how come I don't have to?
UPDATE
The problem was that the docker executable was located in /usr/local/bin/ rather than /usr/bin. I have no idea why docker installed the executable differently despite both machines being OSX.
That's a misleading error, should have asked you to check if the path /usr/bin/docker exists on the host machine. Docker (at least on Mac) will attempt to create a directory if it doesn't exist. Apparently, your team mate isn't logged in with sufficient privileges to create /usr/bin/docker.

Docker-compose throwing error

Hello guys I'm trying to get my vagrant up but the docker keeps on throwing an error which is given below :
Can't find a suitable configuration file in this directory or any parent. Are you in the right directory
The file is present at the root of my project. It was all working well but it just started to throw an error. Can somebody tell me what is it that I have done due to which I'm getting this error
well, I had this error but it was due to vagrant. If you are running vagrant then first of all enter into your vagrant machine using :
vagrant ssh command
and try to find the file over there. If you don't have it over there then this is the problem. That file is not being loaded over here because of which you are getting this error.
My error was coming because vagrant was not mounting the nfs partition because of which the whole project was not loading in the vagrant machine and after that, the docker command was being run. Since the project was not being loaded docker command was not able to find the required file.
If this is your problem try to mount your nfs partition first.
Run:
docker-compose -f rootoftheprojectpath/docker-compose.yml up -d
Check read permissions, typos, etc. Also check that your file is not empty
Regards

Windows could not start the RabbitMQ Service on local Computer

I am trying to start RabbitMQ service on my local Windows laptop but I keep getting this error:
I first downloaded erlang (OTP 19.0 Windows 64-bit Binary File) from here: http://www.erlang.org/downloads.
Then I downloaded RabbitMQ from here: https://www.rabbitmq.com/install-windows.html
Erlang seems to have installed correctly - I don't see any errors in the logs. RabbitMQ shows this message in the installation logs:
Installing RabbitMQ service...
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
C:\Program Files\erl8.0\erts-8.0\bin\erlsrv: Service RabbitMQ added to system.
Error spawning C:\Program Files\erl8.0\erts-8.0\bin\epmd -daemon (error 0)
Starting RabbitMQ service...
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
C:\Program Files\erl8.0\erts-8.0\bin\erlsrv: Failed to start service RabbitMQ.
Error: The process terminated unexpectedly.
I uninstalled both, restarted my laptop and reinstalled but still doesn't work.
I also added Firewall Rules but still no luck. The 2nd firewall rule is for allowing connection for these ports: 4369, 25672, 5672, 5671, 15672, 61613, 61614, 1883, 8883
I think I had the same problem which lies in the error
The filename, directory name, or volume label syntax is incorrect.
... and that maybe when erlang was installed it for some reason is sets the HOMEDRIVE to u: or something silly.
From the command line run:
SET HOMEDRIVE=C:
Then try to run your rabbitmq-service again. You may have to stop, remove, install, start it again.
rabbitmq-service stop
rabbitmq-service remove
rabbitmq-service install
rabbitmq-service start
and please make sure that you have copied the .erlang.cookie from c:\Windows to the root of your user folder ( C:\Users\{user}\ )
Open the command prompt and run the following commands one by one:
c:\>cd\
c:\>cd Program Files
c:\Program Files>cd RabbitMQ Server
c:\Program Files\RabbitMQ Server>dir
c:\Program Files\RabbitMQ Server>cd rabbitmq_server-3.8.1
c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.1>dir
c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.1>cd sbin
c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.1\sbin>dir
c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.1\sbin>SET HOMEDRIVE=C:
c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.1\sbin>rabbitmq-service enable
c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.1\sbin>rabbitmq-plugins enable rabbitmq_management
and please make sure that you have copied the .erlang.cookie from c:\Windows to the root of your user folder ( C:\Users{user}\ )
Pls use below command, this worked for me
rabbitmq-service remove
rabbitmq-service install
rabbitmq-service start
Try
rabbitmq-service install
then
rabbitmq-service start
again

Resources