Docker Compose failed to build - Filesharing has been cancelled - windows

I've ran into an issue with Docker Desktop, currently im running the edge version as a user on Stackoverflow. Before I got the drive not shared for unknown reason error which was "solved" by installing edge version: Docker for Windows: Drive sharing failed for an unknown reason
Now that this was installed im getting this new error which prevents some containers from being built. These containers have all been tested and works on several other systems. Currently 3 out of 4 containers are not built and they all produce the same error as below:
ERROR: for db Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
Encountered errors while bringing up the project.
full error:
Creating imt2291-part2_www_1 ...
Creating imt2291-part2_phpmyadmin_1 ... done
Creating imt2291-part2_db_1 ...
Creating imt2291-part2_test_1 ... error
Creating imt2291-part2_www_1 ... error
ERROR: for imt2291-part2_test_1 Cannot create container for service test: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for imt2291-part2_www_1 Cannot create container for service www: status Creating imt2291-part2_db_1 ... error
lled"}
ERROR: for imt2291-part2_db_1 Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for test Cannot create container for service test: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for www Cannot create container for service www: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for db Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
Encountered errors while bringing up the project.
Has anyone encountered this issue before and found a fix?

You need to update File Sharing configuration in your Docker for Windows app (there is a new security hardening in 2.2.0.0 which has agressive defaults). Add all folders you need and then restart Docker for Windows.

After changing "File Sharing" to C Drive its start working in my windows machine. I am using docker desktop 2.3.0.3

I am using Docker in Windows 10 and had the same problem.
The solution suggested by Oleg Nenashev and Rejoanul Alam helped me.
Adding the project dir where the Dockerfile lives or C:/ to docker shared folders solves the problem.
Step 6 from Getting started states:
Shared folders, volumes, and bind mounts
If your project is outside of the Users directory (cd ~), then you need to share the drive or location of the Dockerfile and volume you are using.
If you get runtime errors indicating an application file is not found, a volume mount is denied, or a service cannot start, try enabling file or drive sharing.
Volume mounting requires shared drives for projects that live outside of C:\Users (Windows) or /Users (Mac), and is required for any project on Docker Desktop for Windows that uses Linux containers.
For more information, see File sharing on Docker for Mac, and the general examples on how to Manage data in containers.
If you are using Oracle VirtualBox on an older Windows OS, you might encounter an issue with shared folders as described in this VB trouble ticket. Newer Windows systems meet the requirements for Docker Desktop for Windows and do not need VirtualBox.

I have meet this problem and my environment is windows. first when the issue happen, I chance the file sharing path to C: , and my project path is in G: ,so the command docker-compose up fail,and the massage is:
docker: Error response from daemon: status code not OK but 500 {"Message":"Unhandled exception: Filesharing has been cancelled"}
I think the file sharing must include your project path. because when I set my file sharing path in other file path , it doesn't work, however, i chance it to the path where is my project path, docker-compose up do successfully!

I had the same error and answers of Oleg Nenashev and Rejoanul Alam helped me to solve this error.
My task was to share volumes between containers.
I have a website folder with file index.html inside:
Open Docker Desktop Settings and write the address of the folder you are working with in File Sharing:
After this open this folder in your command prompt and add the necessary Docker command:
If the command is correct and you did all steps attentively it must be working fine.

Related

Windows Container Access is denied. (0x5). using Powershell. But still accessible on Docker Desktop CLI tool

I am running a docker-compose up and spinning up my Windows containers. Then I want to attach to a container.
I tried docker attach <container id>, but it crashes the entire docker container for whatever reason. Then, I tried docker exec <container name> C:\ to login to C:\.
This gives me the error: container 8504af497601933a0c2e7126e00665da77b9fa71db03c37ce30eb5fa94ee2ee6 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: Access is denied. (0x5)
On my Windows 10 machine, I can still access the CLI for the containers using Docker Desktop (even though its inaccessible through CLI), however, I need to use CLI to access it on my Windows Server 2019 machine. I've tried C:\, C:\Users, etc , and they all give the same error.
I was running this erroneous command:
&$Env:ProgramFiles\Docker\docker run hello-world:nanoserver .
Which resulted in:
docker: Error response from daemon: container encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: Access denied. (0x5).
This is due to . after hello-world:nanoserver which specify the shell to use. The error Access denied was coming from inside the container I think.
So try to check if you are specifying a shell which is incorrect.

My docker-compose up is no longer working and cannot start mariadb

I started using a mac and use docker to develop my sites. Until 12 ago my projects were running properly.
The last activity I tried to on the machine was to install brew mysql, which I already removed. After I restarted my machine, I noticed that I can no longer start any docker container and view a project.
I cd into my project folder and run
docker-compose up
The following error shows up:
Sydney-de-Sousas-Mac:scottishleader.co.za sidney$ docker-compose up
Starting scottishleader_mariadb ... error
ERROR: for scottishleader_mariadb Cannot start service mariadb: driver failed programming external connectivity on endpoint scottishleader_mariadb (30a2e258468e8840ca5e67a535835603770afadab58b3e460e624ae3ba587293): Error starting userland proxy: /forwards/expose/port returned unexpected status: 500
ERROR: for mariadb Cannot start service mariadb: driver failed programming external connectivity on endpoint scottishleader_mariadb (30a2e258468e8840ca5e67a535835603770afadab58b3e460e624ae3ba587293): Error starting userland proxy: /forwards/expose/port returned unexpected status: 500
ERROR: Encountered errors while bringing up the project.
Sydney-de-Sousas-Mac:scottishleader.co.za sidney$
I run docker ps and no container is listed
Sydney-de-Sousas-Mac:scottishleader.co.za sidney$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Why can I suddenly not start the container?

ddev nfs mount fails on win10

I get the following Error when trying to get ddev running with nfs-mounts on win10
ERROR: for web Cannot start service web: error while
mounting volume '/var/lib/docker/volumes/ddev-drupal8_nfsmount/_data': error while
mounting volume with options:
type='nfs' device=':/D/seu/source/drupal8prototyp_' o='addr=host.docker.internal,hard,
nolock,rw': connection refused
I have checked the Windows Defender FW and added the following lines to the nfs_exports.txt file
Any hints on that topic?

Composer-Rest-Server not connecting

I am testing a a business network I created, I ran the Composer-rest-server and all worked fine, then shut the server as suggested in the developers guide , then I proceeded use the yo hyperledger composer to create the skeleton of the angular app, however, now the angular app is showing in the local browser, however, the composer-rest- server is not.
Expected Behavior:
I should start the composer-rest- server in localhost:3000 and the angular app as well
Actual Behavior:
I get this message;
scovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
at _checkRuntimeVersions.then.catch (/home/node/.nvm/versions/node/v6.11.2/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:696:34)
Your Environment
composer-cli#0.11.3
generator-hyperledger-composer#0.11.3
composer-rest-server#0.11.3
Docker version 17.06.0-ce, build 02c1d87
docker-compose version 1.13.0, build 1719ceb
The Problem
If you kill your fabric instance using ./stopFabric that you started using the ./startFabric command then all the containers that were apart of the business network were killed as well and therefore you need to reinstall the .bna and start the network again. (the development flow provided is purposely volatile for rapid development)
The Solution
1.) Type docker ps to see all of your running containers. You should see none if you are getting that error because your peer is not responding to pings
2.) Open a separate terminal and navigate to where you have fabric-dev-servers in the terminal and run ./fabricStart. This will start all the containers like your network Certificate Authority, the peer, the orderer, etc.
3.) Return to your project in another terminal. Do Step 1 & 2 found at the developer tutorial (you likely won't need to do step 3 since you likely already imported the network administrator identity going through the tutorial)
4.) Run composer network ping --card admin#tutorial-network. The ping should go through.
5.) Run docker ps. You should see 4 containers running
6.) Run composer-rest-server and follow the steps from the tutorial.
7.) Run cd tutorial-network-app to switch to where your angular application is (or wherever you generated it with the yo command)
8.) Navigate to http://localhost:3000 and everything should work.
Any other questions or problems just reply here and I can help.
The expected behaviour is that the REST server is already running (the the generator uses Loopback to spin up a REST server already (that's why you shut down the previous REST server)). Its described here https://hyperledger.github.io/composer/unstable/tutorials/developer-guide.html under 'Generate your Skeleton Web Application'.
After you created the application - following completion of the yo hyperledger-composer questions (and after providing the answers) you run your application using npm start from within the generated application directory. Your app is accessible at http://localhost:4200.

Datastore permission denied when running bookshelf sample app locally

I am getting a PERMISSION_DENIED error when attempting to run the sample bookshelf app provided by Google CloudPlatform.
On https://cloud.google.com/java/getting-started/using-forms it says to run the following command:
mvn -Plocal clean jetty:run-exploded -DprojectID=[YOUR-PROJECT-ID]
The error I am getting is:
[WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext#25e203e6{/,file:///Users/markfriesen/Documents/workspace/getting-started-java/bookshelf/2-structured-data/target/bookshelf-2-1.0-SNAPSHOT/,UNAVAILABLE}{/Users/markfriesen/Documents/workspace/getting-started-java/bookshelf/2-structured-data/target/bookshelf-2-1.0-SNAPSHOT}
com.google.cloud.datastore.DatastoreException: Missing or insufficient permissions.
at com.google.cloud.datastore.spi.v1.HttpDatastoreRpc.translate(HttpDatastoreRpc.java:128)
...
Caused by: com.google.datastore.v1.client.DatastoreException: Missing or insufficient permissions., code=PERMISSION_DENIED
at com.google.datastore.v1.client.RemoteRpc.makeException(RemoteRpc.java:126)
at com.google.datastore.v1.client.RemoteRpc.makeException(RemoteRpc.java:169)
I am able to launch the datastore emulator using the command:
gcloud beta emulators datastore start --project=[YOUR-PROJECT-ID]
I am running:
macOS Sierra
Java version: 1.8.0_112
Anyone got ideas?
Thanks
From the error message, it appears that the code is in fact connecting to the real GCD, not the Emulator, and you do not have the Datastore API enabled for the project. I would recommend logging into GCD and enable the Datastore API and try again.
I ran into this problem in a docker context :
I was running the datastore emulator in a docker container within a docker-compose network
I was trying to connect to it from my local machine.
When I ran the command/script from another container connected to the network of the datastore it worked. I guess it's the localhost exception or something like that.

Resources