404 Error when trying to install sbt through brew - scala

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.

Related

Trying to use ipget

I've installed ipget from this github repo: https://github.com/ipfs/ipget. I have followed all steps, i.e.:
go get -d github.com/ipfs/ipgete
cd ${GOPATH}/src/github.com/ipfs/ipget
make install
I now try to run the following command:
ipget
QmQ2r6iMNpky5f1m4cnm3Yqw8VSvjuKpTcK1X7dBR1LkJF/cat.gif -o nyan.gif
When I run this, I get the following error:
zsh: command not found: ipget
What should I do to resolve this issue?
If command is not found you don't have ipget installed yet. Try installing it by downloading a binary from here: https://dist.ipfs.io/#ipget

Running sbt in a Docker Container

I am trying to use Github actions for my scala project and created a Docker workflow for it. Basically, I am trying to install sbt into my container and run the project.
Dockerfile looks like this:
FROM centos:centos8
ENV SCALA_VERSION 2.13.1
ENV SBT_VERSION 1.5.2
RUN yum install -y epel-release
RUN yum update -y && yum install -y wget
# INSTALL JAVA
RUN yum install -y java-11-openjdk
# INSTALL SBT
RUN wget http://dl.bintray.com/sbt/rpm/sbt-${SBT_VERSION}.rpm
RUN yum install -y sbt-${SBT_VERSION}.rpm
RUN wget -O /usr/local/bin/sbt-launch.jar http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/$SBT_VERSION/sbt-launch.jar
WORKDIR /root
EXPOSE 8080
RUN sbt compile
CMD sbt run
But when I push anything, I get the following error:
The command '/bin/sh -c wget http://dl.bintray.com/sbt/rpm/sbt-${SBT_VERSION}.rpm' returned a non-zero code: 8
When I check the link manually (by setting the sbt version), I see indeed bintray responds with 403 forbidden error but status.bintray.com tells all systems are operational.
Am I doing something wrong or is something wrong with bintray?
Forbidden doesnt mean non operational.
I think that url is incorrect as its not hosted on bintray rather jfrog, please see section on Centos which states
remove old Bintray repo file
https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html

Installing Snoopy-ng

I had a problem while installing Snoopy which I couldn't resolve and couldn't find any answers to, so I spent over 8 hours figuring it out and I'm going to post it here so others don't need to struggle.
My problems were that the installation would fail when collecting PIL
The error was:
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
Another error I got was an issue with a python library:
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-7DSxKG/pylibpcap/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-UmzXwX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-7DSxKG/pylibpcap/
The last error I got was that the dpkt couldn't download because of a 404.
the error message I got was:
Collecting https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz
HTTP error 404 while getting https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz
Could not install requirement https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz because of error 404 Client Error: Not Found for url: https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz
Could not install requirement https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz because of HTTP error 404 Client Error: Not Found for url: https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz for URL https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz
After I fixed these errors snoopy installed perfectly, I'll post how I sloved all of these issues now.
I solved these issues by doing the following:
Execute the following commands in terminal.
apt-get update
apt-get upgrade
apt-get install python-libpcap
then either in terminal with nano or using your trusty text editor open the snoopy-ng install.sh:
In terminal cd to where install.sh is kept and type
nano install.sh
go to
echo "[+] Downloading dpkt..."
and by the link link which should be "https://dpkt.googlecode.com/files/dpkt-1.8.tar.gz"
change it to
http://pkgs.fedoraproject.org/repo/pkgs/python-dpkt/dpkt-1.8.tar.gz/0f8e5a4d4b2f5d5faaf7bbfbf3e1e8b7/dpkt-1.8.tar.gz
next save the install.sh, in nano do this by pressing ctrl + x this will exit the file and prompt you to save the file, press y to save changes next go to terminal and type
sudo sh install.sh
Voila! Snoopy should install without any issues.

Error: Invalid or corrupt jarfile sbt/sbt-launch-0.13.5.jar

I have been trying to install spark using the tutorial and everytime I run the command sbt/sbt assembly, I get the error "Error: Invalid or corrupt jarfile sbt/sbt-launch-0.13.5.jar"
I have tried everything: seperately adding the sbt file to the sbt folder in the spark folder, installing sbt individually, checking the download and reinstalling it over again, but in vain. Any advice about what I am doing wrong? Thanks.
Ok, After playing around for a while I finally got it and hopefully this will work for you aswell. That tutorial builds spark, where they do provide prebuilt binaries. I'm using Spark 1.2.0 just as a note (1.4.1 wouldn't work for me)
This is on Ubuntu 15.04 but should work on 14.04 the same
1) Remove the following lines from your bashrc
export SCALA_HOME=/usr/local/src/scala/scala-2.10.4
export PATH=$SCALA_HOME/bin:$PATH
2) Remove and reinstall scala
sudo rm -rf /usr/local/src/scala
# The following line is only needed if you installed scala another way, if so remove the #
# sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
sudo apt-get update
sudo apt-get install scala
3) Download PreBuilt Spark and extract
wget http://d3kbcqa49mib13.cloudfront.net/spark-1.2.0-bin-hadoop2.4.tgz
tar -xzvf spark-1.2.0-bin-hadoop2.4.tgz
4) Run spark-shell
cd spark-1.2.0-bin-hadoop2.4/
./bin/spark-shell
Sources (basically where I've read from, this solution has been trial and error)
https://chongyaorobin.wordpress.com/2015/07/01/step-by-step-of-installing-apache-spark-on-apache-hadoop/
https://gist.github.com/visenger/5496675
If you have downloaded spark package from http://d3kbcqa49mib13.cloudfront.net/spark-1.1.0.tgz then cross check file - "sbt/sbt-launch-0.13.5.jar". If it just contains small (5-6lines) html content then you need to download jar file manually. This html file just indicate that required jar file was not found. You may use follow following steps for centos:
Download jar manually:
wget http://dl.bintray.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.1/sbt-launch.jar ./sbt/sbt-launch-0.13.5.jar
Prevent automatic downloading of jar file:
sed -i '47,68s/^/#/' sbt/sbt-launch-lib.bash
Install spark again:
sbt/sbt assembly
It worked for me without altering scala installation. Hope it helps.
The sbt script does not download properly sbt-launch-0.13.5.jar because there must be something wrong with the URLs it is using. As a result the file that it downloads contains just an HTML header (wither 400 or 302 codes). Until a better solution becomes available, as a workaround I would download manually sbt-launch-0.13.5.jar beforehand.
In the SPARK_HOME/sbt/sbt-launch-lib.bash script replace line 53 to line 57 with following
if hash curl 2>/dev/null; then
(curl --fail --location --silent ${URL1} > ${JAR_DL} ||\
(rm -f "${JAR_DL}" && curl --fail --location --silent ${URL2} > ${JAR_DL})) && \
mv "${JAR_DL}" "${JAR}"
elif hash wget 2>/dev/null; then
(wget --quiet ${URL1} -O ${JAR_DL} ||\
(rm -f "${JAR_DL}" && wget --quiet ${URL2} -O ${JAR_DL})) &&\
mv "${JAR_DL}" "${JAR}"
else
Then try again, run the sbt assembly command
sbt/sbt assembly
Simplest method is install sbt manually as follows
download sbt deb file
wget http://dl.bintray.com/sbt/debian/sbt-0.13.5.deb
Then run
sudo dpkg -i sbt-0.13.5.deb
sudo apt-get update
sudo apt-get install sbt
then build using
sbt assembly instead of sbt/sbt assembly from spark home folder
#Frozenfire, I'am not sure if it's possible but the Spark documentation Overview says :
For the Scala API, Spark 1.4.1 uses Scala 2.10. You will need to use a
compatible Scala version (2.10.x).
And I wonder if it would be the reason why you have this problem:
I'm using Spark 1.2.0 just as a note (1.4.1 wouldn't work for me)
Because you do :
sudo dpkg -i scala-2.11.7.deb
which downloads and installs scala-2.11.7.
I don't know but this might be a clue !
PS1: this is more a comment to Frozenfire's answer, but I can't comment because of a lack of reputation and I wanted to share this.
PS2: Building for Scala 2.11

Error: Could not retrieve sbt 0.13.8

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?