Error: Could not retrieve sbt 0.13.8 - scala

i have fresh ubuntu 15.04 and i installed sbt by this guide with
echo "deb http://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-get update
sudo apt-get install sbt
then i just run command in terminal
sbt
output saying that sbt is trying to install (many many [SUCCESS] messages) and after all there are some error messages like
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.json4s#json4s-core_2.10;3.2.10: not found
unresolved dependency: org.spire-math#jawn-parser_2.10;0.6.0: not found
unresolved dependency: org.spire-math#json4s-support_2.10;0.6.0: not found
download failed: org.scalamacros#quasiquotes_2.10;2.0.1!quasiquotes_2.10.jar
Error during sbt execution: Error retrieving required libraries
(see /home/dima/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.8
here is a full log from /home/dima/.sbt/boot/update.log
help please what should i do to fix this?
thanks

There are a number of errors like these in the logs:
SERVER ERROR: Connection timed out url=https://repo1.maven.org/maven2/org/scalamacros/quasiquotes_2.10/2.0.1/quasiquotes_2.10-2.0.1.pom.sha1
These suggest there was a (perhaps) temporary network issue. If you try the URL with get or curl do you see a similar error?

Related

module not found: org.scala-sbt#sbt;1.1.6

I installed SBT via terminal with following commands:
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
on my Ubuntu 18.04 and with java version:
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.18.04.1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
The installation was successful but when I tried to start SBT via terminal, then I've got
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.6/ivys/ivy.xml
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;1.1.6: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.1.6/ivys/ivy.xml
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.6/ivys/ivy.xml
What is wrong?
Update
developer#monad:~$ sudo apt-get purge openjdk-8-jdk java-common
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:
openjdk-11-jre-headless : Depends: ca-certificates-java but it is not going to be installed
Depends: java-common (>= 0.28) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
List of installed java version:
developer#monad:~$ update-java-alternatives --list
java-1.11.0-openjdk-amd64 1101 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
Update 2
sudo apt-get install ca-certificates-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates-java is already the newest version (20170930ubuntu1).
ca-certificates-java set to manually installed.
The following packages were automatically installed and are no longer required:
libice-dev libsm-dev libxt-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
The root cause is a conflict between openjdk-11-jdk (which is default in Ubuntu 18.04) and sbt packages settings. It has already been fixed in Debian and will be included in Ubuntu shortly. Meanwhile the simplest workaround is to demote your java to version 8. Other solutions employing ca-certificates-java are much more complicated.
First remove conflicting packages:
sudo apt-get remove --purge openjdk* java-common default-jdk
sudo apt-get remove --purge sbt
sudo apt-get autoremove --purge
Check weather you successfully removed all related packages by:
sudo update-alternatives --config java
The system shall prompt you there is no Java available to config, otherwise this workaround fails.
Then reinstall required packages:
sudo apt-get install openjdk-8-jdk sbt
Test by:
sbt compile
Problem is java-certificates so you need to run these commands:
Reinstall JDK
$ sudo apt-get purge openjdk-8-jdk java-common
$ sudo apt-get install openjdk-8-jdk
Run sbt
$ sbt
I would recommend you install Java/Scala/SBT totally independent from the OS packages. It does not matter (or should not matter!) for a developer which specific version of Java was installed by apt-get, yum or whatever.
From the developer's perspective, it may even make sense to test your application under several versions of Java. I've seen this situation before: "it works" under Java 1.8.x but "it fails" under Java 1.8.y.
So, from a developers, perspective, you would be interested on quickly swithing versions of Java, so that you can quickly make sure it works properly under those several different versions, no matter which specific version is installed on your specific version of the OS.
If you liked the idea, this is how it works:
Download manually all JDK versions you like and uncompress them under a given folder under your home folder, say: $HOME/tools. I have a script which automagically installs a certain version of the JDK for you: https://github.com/frgomes/bash-scripts/blob/master/scripts/user-install/install-java.sh
Adjust environment variables in a virtualenv-like fashion. It's easier than you think and you dont't even need virtualenv. All you need is to source a shell script which runs at login time which defines JAVA_HOME, pointing to a given version of Java, under your $HOME/tools. This is an example: https://github.com/frgomes/bash-scripts/blob/master/bashrc-virtualenvs/j8s12/bin/postactivate
Install Scala and SBT versions by hand, or using my automated script at https://github.com/frgomes/bash-scripts/blob/master/scripts/user-install/install-scala.sh
This fixed it for me.
sudo update-ca-certificates -f
In my case, I solved it by removing .m2, .ivy & .sbt.
Next time I executed sbt, it fixed everything.
I believe I broke sbt when I was playing with the cached dependencies or something else.

FIRRTL repository download failed

I installed sbt following this: http://www.scala-sbt.org/release/docs/Installing-sbt-on-Linux.html
Now, i'm trying to get firrtl set up
https://github.com/ucb-bar/firrtl
But "sbt compile" throws an error:
::::::::::::::::::::::::::::::::::::::::::::::
:: FAILED DOWNLOADS ::
:: ^ see resolution messages for details ^ ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#main;0.13.11!main.jar
:: org.scala-sbt#actions;0.13.11!actions.jar
:: org.scala-sbt#io;0.13.11!io.jar
:: org.scala-sbt#completion;0.13.11!completion.jar
:: org.scala-sbt#collections;0.13.11!collections.jar
:: org.scala-sbt#api;0.13.11!api.jar
:: org.scala-sbt#incremental-compiler;0.13.11!incremental-compiler.jar
:: org.scala-sbt#compile;0.13.11!compile.jar
:: org.scala-sbt#ivy;0.13.11!ivy.jar
:: org.scala-sbt#main-settings;0.13.11!main-settings.jar
:: org.scala-sbt#command;0.13.11!command.jar
:: org.scala-sbt#compiler-interface;0.13.11!compiler-interface.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
download failed: org.scala-sbt#main;0.13.11!main.jar
download failed: org.scala-sbt#actions;0.13.11!actions.jar
download failed: org.scala-sbt#io;0.13.11!io.jar
download failed: org.scala-sbt#completion;0.13.11!completion.jar
download failed: org.scala-sbt#collections;0.13.11!collections.jar
download failed: org.scala-sbt#api;0.13.11!api.jar
download failed: org.scala-sbt#incremental-compiler;0.13.11!incremental-compiler.jar
download failed: org.scala-sbt#compile;0.13.11!compile.jar
download failed: org.scala-sbt#ivy;0.13.11!ivy.jar
download failed: org.scala-sbt#main-settings;0.13.11!main-settings.jar
download failed: org.scala-sbt#command;0.13.11!command.jar
download failed: org.scala-sbt#compiler-interface;0.13.11!compiler-interface.jar
Error during sbt execution: Error retrieving required libraries
(see /home/user/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.11
The download failed for some files but i can't figure out why.
The only related post i found is this one. But i'm not sure if it's a connectivity issue...
Reinstalling and cleaning the whole thing did not help...
I'm working on ubuntu 16.04.1
The error was within the certificates of openjdk-9. I found this post and did the following to solve the failed downloads:
Uninstall OpenJDK 9:
sudo apt-get remove openjdk-9-*
Install OpenJDK 8:
sudo apt-get install openjdk-8-jdk
Reinstall sbt: (Reference)
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
After doing so, i was able to execute
sbt compile

404 Error when trying to install sbt through brew

I'm trying to brew install sbt and getting this:
==> Downloading http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.5/sbt-launch.jar
curl: (22) The requested URL returned error: 404 Not Found Error:
Failed to download resource "sbt" Download failed:
http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.5/sbt-launch.jar
Any ideas how to fix it?
I prefer not to install it globally. Use:
$ cat get_sbt.sh
#!/bin/bash
curl -s https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt > sbt \
&& chmod 0755 sbt
Then run with:
./sbt
It will download the latest for you.

Error in verifying sbt installation

I am new to Scala and have just downloaded sbt on my Mac.
After installing using the following command -
brew install sbt
i am trying to verify that the installation completed successfully by running this command -
sbt --version
I am expecting something like -
sbt launcher version 0.13.0
but getting the following instead -
sbt --version
[error] Not a valid command: version (similar: session)
[error] version
[error] ^
I have tried to uninstall and reinstall sbt on my machine but in vain.
Can someone let me know what I could be missing here?
thanks!
SBT launcher script simply doesn't support --version. Run sbt -h to see supported options. To show the SBT version used for current project, run sbt "show sbtVersion".

Could not retrieve sbt 0.13.9 on fresh Ubuntu install

After a fresh install of Ubuntu 15.04, I attempted to install and run SBT using the instructions from www.scala-sbt.org. It installed fine, but when I run it for the first time, I get a bunch of errors:
~$ sbt
...
:::: ERRORS
Server access Error: java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.9/sbt-0.13.9.jar
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.9: not found
Error during sbt execution: Error retrieving required libraries
(see /root/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.9
What is going wrong?
I have had same problem with xubuntu 15.10. I installed package ca-cacert:
sudo apt-get install ca-cacert
It solved this problem.
After a bit of debugging, I found that the cacerts file is missing from the latest version of OpenJDK.
All I had to do was copy the cacerts file from /etc/ssl/certs/java/cacerts from a working computer to my new workstation, and it worked fine.
I've made my file available at this link.