Hello,
I'm trying to install Service Fabric on Linux (Ubuntu 16.04.5 - 64bit) in order to set up a Java application.
So, I have some troubles installing the Fabric. I have followed the official docs https://docs.microsoft.com/fr-fr/azure/service-fabric/service-fabric-get-started-linux#installation-methods
but the script sudo curl -s https://raw.githubusercontent.com/Azure/service-fabric-scripts-and-templates/master/scripts/SetupServiceFabric/SetupServiceFabric.sh | sudo bash
does not work.
Error:
``dadi@dadi-VirtualBox:~$ sudo curl -s https://raw.githubusercontent.com/Azure/service-fabric-scripts-and-templates/master/scripts/SetupServiceFabric/SetupServiceFabric.sh | sudo bash
[sudo] password for haddadi:
Executing: /tmp/tmp.CFSYesTboj/gpg.1.sh --keyserver
apt-mo.trafficmanager.net
--recv-keys
417A0893
gpg: requesting key 417A0893 from hkp server apt-mo.trafficmanager.net
gpg: key 417A0893: "MS Open Tech interop@microsoft.com" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 983 100 983 0 0 1480 0 --:--:-- --:--:-- --:--:-- 1482
OK
OK
Hit:1 http://apt-mo.trafficmanager.net/repos/servicefabric xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:3 http://fr.archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://fr.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 https://download.docker.com/linux/ubuntu xenial InRelease
Hit:6 http://fr.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:7 https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial InRelease
Fetched 107 kB in 1s (90,1 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
servicefabricsdkcommon : Depends: servicefabric (>= 6.4.625.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Error@61: Failed to install Service Fabric SDK``
Do you have any idea? about this issue? because I'm stuck.
thanks in advance.
Dadi
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hello @NiceMan92
Thank you for your feedback! We will investigate and get back to you with our findings.
Hi @mike-urnun-msft you are Welcome.
FYI: I have already set up the environment twice 2 weeks ago, and everything was Ok. The problem showed up this week. That's strange. I think that something went wrong on the Ubuntu packages repository (but I'm not sure).
thanks.
@NiceMan92 I followed the doc and i got the same error. After troubleshooting i got some info.
servicefabricsdkcommon
depends on servicefabric
package.
servicefabric
depends on zulu-8-azure-jdk
. Zulu JDK is missing in the the system and we don't have any repos which points to that.
Generally script should install JDK or at least it should check if that package is there or not and warn.
Since it worked for you two weeks before, something would have changed.
Till we fix this problem, We have a workaround through which we can install the Zulu JDK manually.
Thanks for all this @jakaruna-MSFT. I can confirm I see the same thing but the work around did resolve.
@mani-ramaswamy can you take a look at this? Seems we need to update the doc or update the samples.
CC @aljo-microsoft
Hi guys, the script works now, I have installed the service fabric
Thank you @jakaruna-MSFT
Dadi
@jakaruna-MSFT
Now, I have a problem with deploying my application, even Voting.
Here is the error :
exit-code:0
Running command:/bin/bash /home/dadi/git/LocalDisseminationRepository/Dissemination/Scripts/connect.sh -ip localhost -port 19080
Shell output:parameters: ip=localhost, port=19080, clientKey=0, clientCert=0
For local cluster, check if the cluster is already up or not and accordingly set up the cluster.
Local cluster is up, now will try to connect to the cluster.
Connecting to http://localhost:19080
Something went wrong while connecting to cluster.
exit-code:1
Error in connecting to cluster.
Running command:/bin/bash /home/haddadi/git/LocalDisseminationRepository/Dissemination/Scripts/deploy.sh 1.0.0
Shell output:Deploying with ApplicationTypeVersion 1.0.0
Application copy failed.
Error occurred while deploying application.
exit-code:1
Error in deploying application.
Any idea ?
Thanks in advance.
@NiceMan92
As mentioned in the java quick start doc (https://github.com/Azure-Samples/service-fabric-java-quickstart), you should start the local cluster and check if its fully up. Only after that you should try to deploy the apps.
1.Start your local cluster by running the following command:
sudo /opt/microsoft/sdk/servicefabric/common/clustersetup/devclustersetup.sh
"The startup of the local cluster takes some time. To confirm that the cluster is fully up, access the Service Fabric Explorer at http://localhost:19080. The five healthy nodes indicate the local cluster is up and running."
Are you invoking the connect script immediately after the devClusterScript completes ? This would try to connect without waiting for the cluster to be healthy and that connection fails. Either invoke devclustersetup.sh and wait or invoke invoke the connect.sh directly without setting up the cluster.
@mani-ramaswamy we are planning to update the documentation and the devclusterscript to include the zulu package installation.
@anantshankar17 thank you for your response. I have used Service fabric with Eclipse many times and everything went Ok. I know that the SF takes a few minutes to start and I deployed Java App many times on the SF without problems :). So this Week, I would reinstall the SF on a new computer and I had a problem (the topic of this issue). So I posted this issue and @jakaruna-MSFT Helped me to reinstall the SF. I succeed to reinstall and start the SF, and the five nodes are healthy as usual. My problem now is when I deploy the Application on the local cluster via the Plug-in Eclipse:
6- Right click on the project and select Publish Application... under the Service Fabric dropdown. Choose PublishProfiles/Local.json as the Target Profile and click Publish
I get this error :
exit-code:0
Running command:/bin/bash /home/haddadi/git/service-fabric-java-quickstart/Voting/Scripts/connect.sh -ip localhost -port 19080
Shell output:parameters: ip=localhost, port=19080, clientKey=0, clientCert=0
For local cluster, check if the cluster is already up or not and accordingly set up the cluster.
Local cluster is up
, now will try to connect to the cluster.
Connecting to http://localhost:19080
Something went wrong while connecting to cluster.
exit-code:1
Error in connecting to cluster.
Running command:/bin/bash /home/haddadi/git/service-fabric-java-quickstart/Voting/Scripts/deploy.sh 1.0.0
Shell output:Deploying with ApplicationTypeVersion 1.0.0
Application copy failed.
Error occurred while deploying application.
exit-code:1
Error in deploying application.
I'm Stuck ..... since last Friday, and I don't know what I have to do.
The error that you get is only returned when the connection to the cluster doesnt succeed.
What does this cmd do for you ?: sfctl cluster select --endpoint http://localhost:19080
dadi@dadi-VirtualBox:\~$ sudo sfctl cluster select --endpoint http://localhost:19080
dadi@dadi-VirtualBox:~$
It does nothing
That means the connection to the cluster is indeed working without any error, but the error check immediately after this cmd is returning an error in the script: https://github.com/Azure-Samples/service-fabric-java-quickstart/blob/master/Voting/Scripts/connect.sh.
Can you please remove the error check and try ?
echo "Connecting to $url"
sfctl cluster select --endpoint $url $certArgs
if [ $? != 0 ]; then
echo "Something went wrong while connecting to cluster."
exit 1
fi
I think the error check should ideally be: if [ $? -ne 0 ]; then
I removed if [ $? != 0 ]; then
echo "Something went wrong while connecting to cluster."
exit 1
fi
From code, I have Application copy failed.
as error now
exit-code:0
Running command:/bin/bash /home/haddadi/git/service-fabric-java-quickstart/Voting/Scripts/connect.sh -ip localhost -port 19080
Shell output:parameters: ip=localhost, port=19080, clientKey=0, clientCert=0
For local cluster, check if the cluster is already up or not and accordingly set up the cluster.
Local cluster is up, now will try to connect to the cluster.
Connecting to http://localhost:19080
Connected to:http://localhost:19080
exit-code:0
Running command:/bin/bash /home/haddadi/git/service-fabric-java-quickstart/Voting/Scripts/deploy.sh 1.0.0
Shell output:Deploying with ApplicationTypeVersion 1.0.0
Application copy failed.
Error occurred while deploying application.
exit-code:1
Error in deploying application.
@anantshankar17 you are right some error check in the script went wrong.
It works when I use the command lines as follow:
haddadi@haddadi-VirtualBox:~/git/LocalDisseminationRepository/Dissemination$ sudo sfctl cluster select --endpoint http://localhost:19080
haddadi@haddadi-VirtualBox:~/git/service-fabric-java-quickstart/Voting/VotingApplication$ sudo sfctl application upload --path /home/haddadi/git/service-fabric-java-quickstart/Voting/VotingApplication
haddadi@haddadi-VirtualBox:~/git/service-fabric-java-quickstart/Voting/VotingApplication$ sudo sfctl application provision --application-type-build-path VotingApplication --no-wait
haddadi@haddadi-VirtualBox:~/git/service-fabric-java-quickstart/Voting/VotingApplication$ sudo sfctl application create --app-name fabric:/VotingApplication --app-type VotingApplicationType --app-version 1.0.0
haddadi@haddadi-VirtualBox:~/git/service-fabric-java-quickstart/Voting/VotingApplication$
I think that the problem comes from the command sfctl
I don't know why I get [Errno 13] Permission denied ?
haddadi@haddadi-VirtualBox:/$ sfctl
[Errno 13] Permission denied: '/home/haddadi/.sfctl/config'
Traceback (most recent call last):
File "/home/haddadi/.local/lib/python3.5/site-packages/knack/cli.py", line 206, in invoke
cmd_result = self.invocation.execute(args)
File "/home/haddadi/.local/lib/python3.5/site-packages/knack/invocation.py", line 144, in execute
self.help.show_welcome(subparser)
File "/home/haddadi/.local/lib/python3.5/site-packages/knack/help.py", line 654, in show_welcome
self.show_privacy_statement()
File "/home/haddadi/.local/lib/python3.5/site-packages/knack/help.py", line 648, in show_privacy_statement
self.cli_ctx.config.set_value('core', 'first_run', 'yes')
File "/home/haddadi/.local/lib/python3.5/site-packages/knack/config.py", line 95, in set_value
self.set(config)
File "/home/haddadi/.local/lib/python3.5/site-packages/knack/config.py", line 82, in set
with open(self.config_path, 'w') as configfile:
PermissionError: [Errno 13] Permission denied: '/home/haddadi/.sfctl/config'
Yes that seems to be a permission issue. Can you delete this folder altogether and then retry: /home/haddadi/.sfctl
Effectively that was the origin of the problem. After installing the Service Fabric, you have to delete /home/userName/.sfctl
folder in order to fix the issue. I know that was painful but that's it.
Thank you guys for your help and your reactivity :)
P.S. I think that the doc should be updated asap in order to make the installation more easier
thanks @NiceMan92 for your patience.
Follow up questions, since you have updated the runtime/sdk I am hoping that your devclustersetup.sh is the latest version,with which you should not be hitting this. This issue in sfctl hasn't yet been fixed, hence we were removing that ".sfctl" folder at the end of the setup, so that users do not hit this issue, which occurs when the first devclustersetup is executed with sudo and other users are used for subsequent sfctl usage.
Most helpful comment
@NiceMan92 I followed the doc and i got the same error. After troubleshooting i got some info.
servicefabricsdkcommon
depends onservicefabric
package.servicefabric
depends onzulu-8-azure-jdk
. Zulu JDK is missing in the the system and we don't have any repos which points to that.Generally script should install JDK or at least it should check if that package is there or not and warn.
Since it worked for you two weeks before, something would have changed.
Till we fix this problem, We have a workaround through which we can install the Zulu JDK manually.
Try this out and let me know.