Travis CI fails to unzip gradle 1.11 with gradle wrapper - gradle

Since today, the builds of one of my projects fail on Travis CI, because of issues in unzipping gradle 1.11. This applies to newer builds as well as old builds that were executed fine days ago. gradlew assemble works fine on my local machine, it only fails on Travis CI. The output of the build is the following:
Using worker: worker-linux-6-2.bb.travis-ci.org:travis-linux-9
$ git clone --depth=50 --branch=master git://github.com/lenhard/pete.git lenhard/pete
Cloning into 'lenhard/pete'...
remote: Counting objects: 779, done.
remote: Compressing objects: 100% (567/567), done.
remote: Total 779 (delta 325), reused 571 (delta 134)
Receiving objects: 100% (779/779), 4.20 MiB | 0 bytes/s, done.
Resolving deltas: 100% (325/325), done.
Checking connectivity... done.
$ cd lenhard/pete
$ git checkout -qf 5bef29676d981c7de80517950cbb9b1bb85bba00
$ jdk_switcher use oraclejdk8
Switching to Oracle JDK8 (java-8-oracle), JAVA_HOME will be set to /usr/lib/jvm/java-8-oracle
update-alternatives: error: no alternatives for apt.
$ java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b128)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b69, mixed mode)
$ javac -version
javac 1.8.0
before_install
$ chmod +x gradlew
$ ./gradlew assemble
Downloading http://services.gradle.org/distributions/gradle-1.11-bin.zip
Unzipping /home/travis/.gradle/wrapper/dists/gradle-1.11-bin/4h5v8877arc3jhuqbm3osbr7o7/gradle-1.11-bin.zip to /home/travis/.gradle/wrapper/dists/gradle-1.11-bin/4h5v8877arc3jhuqbm3osbr7o7
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.zip.ZipFile.<init>(ZipFile.java:164)
at org.gradle.wrapper.Install.unzip(Install.java:148)
at org.gradle.wrapper.Install.createDist(Install.java:65)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
Travis tries to repeat gradlew assemble two more times, but fails ultimately. My .travis.yml is really simple:
language: java
jdk:
- oraclejdk8
before_install:
- chmod a+x gradlew
Where could this issue come from? When accessing http://services.gradle.org/distributions/gradle-1.11-bin.zip from my machine, I get a proper distribution that can be unzipped and works. Could this be related to the fact that I use JDK 1.8?

The issue was neither caused by Travis CI, nor by the project configuration. Instead, it seems that the gradle wrapper had problems following redirects for a new host. This came from the enablement of https downloads for the wrapper at gradle.org. The problem was fixed on their side and everything is back to normal now.
More info on this problem can be found in the gradle forums.

Related

Errors running the first Go project on the local machine

I've installed the latest version of Go on my local machine, downloaded the source code from https://github.com/rrrkren/topshot-sales, and placed the project code in my GOPATH.
When I run it go run go/main.go in my command prompt, I get these errors
go\main.go:8:2: no required module provides package github.com/onflow/flow-go-sdk/client: go.mod file not found in current directory or any parent directory; see 'go help modules'
go\main.go:6:2: no required module provides package github.com/rrrkren/topshot-sales/topshot: go.mod file not found in current directory or any parent directory; see 'go help modules'
go\main.go:9:2: no required module provides package google.golang.org/grpc: go.mod file not found in current directory or any parent directory; see 'go help modules'
Even though the go.mod file is located in the current directory. I would like to be able to download this project and keep it on my local machine, so I can edit the source code whenever I want. How can I do that?
This is what worked for me.
Step 1. Delete any previous Go version if you are doubtful about having it configured properly.
Step 2. Install new Go version. Download the binary release (Go) from here Go Binary Download
Note: In order to delete and install the new Go version you can use these steps - Go Deletion and Installation, they worked for me. Also the version I am currently using is 1.16.3.
Step 3. After completing step 1 and step 2, run the following command in a terminal:
go env -w GO111MODULE=auto
This should do it.
You should not need a GOPATH environment variable with Go 1.16.
Only:
GO111MODULE=on (won't be needed in Go 1.17 or 1.18)
GOPROXY=https://proxy.golang.org,direct
GOROOT=C:\path\to\go
(GOROOT unless you have installed Go in its default folder: %USERPROFILE%\go)
I tried:
D:\git> git clone https://github.com/rrrkren/topshot-sales
Cloning into 'topshot-sales'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 25 (delta 9), reused 21 (delta 6), pack-reused 0
Receiving objects: 100% (25/25), 16.95 KiB | 5.65 MiB/s, done.
Resolving deltas: 100% (9/9), done.
D:\git> cd topshot-sales
D:\git\topshot-sales> go run main.go
go: downloading github.com/onflow/flow-go-sdk v0.10.0
...
go: downloading gopkg.in/yaml.v2 v2.2.5
panic: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 35.193.214.129:9000: i/o timeout"
goroutine 1 [running]:
main.handleErr(...)
D:/git/topshot-sales/main.go:14
main.main()
D:/git/topshot-sales/main.go:23 +0x805
exit status 2
No error about go.mod, only a runtime execution error.
If you're on macOS, run the following command first and then retry:
xcode-select --install
Reference: Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Monterey?

Windows Luarocks install permission error

I have been trying for two weeks to install lua 5.1 and luarocks on windows. Please help.
What i have:
Downloaded MinGw
Installed Lua 5.1. I downloaded sources from official site and compiled with MinGw
Downloaded binary luarocks file.
Installed binary files in variable PATH
Windows terminal with admin privileges
If i tried to run next command
luarocks --lua-version=5.1 install luasql-mysql MYSQL_DIR="c:/Program Files/MySQL/MySQL Server 8.0"
I will get error
C:\Windows\system32>luarocks --lua-version=5.1 install luasql-mysql MYSQL_DIR="c:/Program Files/MySQL/MySQL Server 8.0"
Installing https://luarocks.org/luasql-mysql-2.6.0-1.rockspec
Cloning into 'luasql'...
remote: Enumerating objects: 149, done.
remote: Counting objects: 100% (149/149), done.
remote: Compressing objects: 100% (100/100), done.
Receiving objects: 88% (132/149)sed 71 (delta 35), pack-reused 0Receiving objects: 86% (129/149)
Receiving objects: 100% (149/149), 104.00 KiB | 918.00 KiB/s, done.
Resolving deltas: 100% (72/72), done.
luasql-mysql 2.6.0-1 depends on lua >= 5.1 (5.1-1 provided by VM)
Error: Failed setting permission exec for all
I tried to compile luarocks from source and also got access error. What am I doing wrong?
Possible answer found here: https://stackoverflow.com/a/38534015/3342050
"I was able to install it from source on github (keplerproject/luasql) by modifying the config file. Lua 5.2 was hard-coded in the config file, but I'm running 5.1."
"In the config file, replace LUA_SYS_VER ?= 5.2 with LUA_SYS_VER ?= 5.1"
https://github.com/keplerproject/luasql/blob/8c58fd6ee32faf750daf6e99af015a31402578d1/config#L7

Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8)'

Trying to deploy my app to heroku, but it keeps failing with the error:
Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8)'
I have my JAVA_HOME,JAVA_PATH,and so on.. set up, i have an image of all of them here, i think they are correct. If i check java -version, and javac -version, they both show java 11.
I also tried putting to the root folder a system.properties.txt file and also instead of .txt a .gradle file with java.runtime.version=11 inside it.
Also i have this in my build.gradle:
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
But it keeps installing jdk8 at the start of the deploy(git push heroku master) like this:
Gradle app detected
remote: -----> Spring Boot detected
remote: -----> Installing JDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew build -x test
remote: Downloading https://services.gradle.org/distributions/gradle-5.4.1-all.zip
here are the Images of the deploy failing and the environmental variables that are set up.
I have been with this problem for a week now, i think i tried all, but i would be really greatful if someone could help me with this. Thank you!
I had the same problem getting a "Java SE 11 using tool chain JDK 8" error. After Googling the problem, I was hinted toward the JAVA_HOME settings.
I use sdkman to manage my Java and Kotlin versions current version settings so after checking the current Java version configured in sdkman, I realized it was pointing to the GraalVM version 19 which targets Java 8.
So I simply reinstated the current JAVA_HOME to 11 with "sdkman use java 11.0.1-zulu" and everything was working fine.
Softjake
Add a system.properties file to your project with this line of code.
java.runtime.version=11
It sounds like you already solved your problem by renaming system.properties.txt to system.properties. (By the way, it's okay to answer your own question!)
In case it's helpful for anyone else, this is the official documentation from Heroku:
Create a system.properties file if one does not already exist, specify the version, and commit it to git. Supported version are described in the Java Support article. The file’s contents should look something like this:
java.runtime.version=11
https://devcenter.heroku.com/articles/customizing-the-jdk#specify-a-jdk-version
I had the same problem using openjdk 11 in linux Ubuntu.
But it worked ok in my work laptop. Same OS Ubuntu 18.04 LTS.
I checked version of jdk in my laptop it was:
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
but it inside is using tool chain: 'JDK 10 (1.10)'
so I got this message
using tool chain: 'JDK 10 (1.10)'
I check my work laptop and it has
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)
Searching about openjdk I discovered this site
https://adoptopenjdk.net
where I could get OpenJDK 11 (LTS) build 11.0.4+11
After I added it to alternatives
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-11.0.4+11/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-11.0.4+11/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk-11.0.4+11/bin/javadoc" 1
and then choose everyone of them
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javadoc
After problem was solved.
I hope this can help someone else.
I don't know why but heroku doesnt't detect provided by gradle version
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Once I changed it to plain string JDK 11 was detected
sourceCompatibility = '11'
targetCompatibility = '11'
result:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/jvm
remote: -----> heroku-deploy app detected
remote: -----> Installing JDK 11... done
remote: -----> Discovering process types
remote: Procfile declares types -> web

Deploying PhantomJS 2.5 beta on Heroku. How can I see what's failing?

I'm trying to make a custom buildpack to deploy PhantomJS 2.5 beta version on Heroku. This is my buildpack based on Stomita's Phantomjs Buildpack which runs version 2.1.1 and works fine.
This is what I get in the building process:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> PhantomJS app detected
remote: -----> Fetching PhantomJS 2.5.0-beta binaries at https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.5.0-beta-linux-ubuntu-trusty-x86_64.tar.gz
remote: ! Push rejected, failed to compile PhantomJS app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to rp-phantom.
remote:
As you can see, not much information. The binary is downloaded fine, I checked that omitting the -s flag in the curl command, but can't figure out what's failing.
This is my compile file:
#!/bin/sh
set -e
BUILD_DIR=$1
CACHE_DIR=$2
# config
VERSION="2.5.0-beta"
# Buildpack URL
ARCHIVE_NAME=phantomjs-${VERSION}-linux-ubuntu-trusty-x86_64
FILE_NAME=${ARCHIVE_NAME}.tar.gz
BUILDPACK_PHANTOMJS_PACKAGE=https://bitbucket.org/ariya/phantomjs/downloads/${FILE_NAME}
mkdir -p $CACHE_DIR
if ! [ -e $CACHE_DIR/$FILE_NAME ]; then
echo "-----> Fetching PhantomJS ${VERSION} binaries at ${BUILDPACK_PHANTOMJS_PACKAGE}"
curl $BUILDPACK_PHANTOMJS_PACKAGE -L -s -O $CACHE_DIR/$FILE_NAME
fi
echo "-----> Extracting PhantomJS ${VERSION} binaries to ${BUILD_DIR}/vendor/phantomjs"
mkdir -p $CACHE_DIR/$ARCHIVE_NAME
mkdir -p $BUILD_DIR/vendor
tar -xvf $CACHE_DIR/$FILE_NAME -C $CACHE_DIR
mv $CACHE_DIR/$ARCHIVE_NAME $BUILD_DIR/vendor/phantomjs
echo "-----> exporting PATH and LIBRARY_PATH"
PROFILE_PATH="$BUILD_DIR/.profile.d/phantomjs.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:$HOME/vendor/phantomjs/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:vendor/phantomjs/lib"' >> $PROFILE_PATH
Thanks in advance!
I was able to get 2.5.0 beta working on Heroku. Here is my answer from my own post:
Ultimately, I was able to figure it out! There are a few things that you have to do...
Dependencies: You have to use the Heroku Apt buildpack to install the missing dependencies. First, you need to add the buildpack to your app:
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
Next, you'll create a file in your project root called Aptfile. Here's where we add the missing dependencies for PhantomJS 2.5.0 Beta. 2.5.0 introduces webp support, so we need that. libhyphen0 is required as well, though I'm not sure how it us used. Finally, we use gcc-5 and the latest libstdc++6. Contents should look like this:
webp
libhyphen0
https://mirrors.kernel.org/ubuntu/pool/main/g/gcc-5/gcc-5_5.4.1-8ubuntu1_amd64.deb
https://mirrors.kernel.org/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.4_amd64.deb
PhantomJS: Next we grab the latest version of PhantomJS. I've created a fork of the most popular PhantomJS buildpack and updated it for use with 2.5.0 beta. 2.5.0 beta has builds for trusty as well as xenial, so the build pack will detect the Heroku stack and use the appropriate one (though the cedar-16 stack is still in beta at the time of this post). So, add it to your app:
heroku buildpacks:add https://github.com/lookitsatravis/heroku-buildpack-phantomjs.git
Deploy: All that's left is deployment! Commit the Aptfile to your repo, make sure the build packs are setup, and then push to Heroku.
Took a bit of trial and error, but ultimately I was able to get it up and running. Hope this helps others until the final candidate is released.

git flow installer fails to install shFlags on the Mac OS X 10.8.3

Tried this several times including nuking the previous download and manually getting the submodule. Does anyone have a workaround?
SilverFir-2:SRC mike$ sudo ./git-flow-installer
### gitflow no-make installer ###
Installing git-flow to /usr/local/bin
Cloning repo from GitHub to gitflow
Cloning into 'gitflow'...
remote: Counting objects: 1407, done.
remote: Compressing objects: 100% (602/602), done.
remote: Total 1407 (delta 893), reused 1285 (delta 790)
Receiving objects: 100% (1407/1407), 358.18 KiB | 121 KiB/s, done.
Resolving deltas: 100% (893/893), done.
Updating submodules
Submodule 'shFlags' (git://github.com/nvie/shFlags.git) registered for path 'shFlags'
Cloning into 'shFlags'...
fatal: unable to connect to github.com:
github.com[0: 204.232.175.90]: errno=Operation timed out
Clone of 'git://github.com/nvie/shFlags.git' into submodule path 'shFlags' failed
install: gitflow/git-flow -> /usr/local/bin/git-flow
install: gitflow/git-flow-init -> /usr/local/bin/git-flow-init
install: gitflow/git-flow-feature -> /usr/local/bin/git-flow-feature
install: gitflow/git-flow-hotfix -> /usr/local/bin/git-flow-hotfix
install: gitflow/git-flow-release -> /usr/local/bin/git-flow-release
install: gitflow/git-flow-support -> /usr/local/bin/git-flow-support
install: gitflow/git-flow-version -> /usr/local/bin/git-flow-version
install: gitflow/gitflow-common -> /usr/local/bin/gitflow-common
install: gitflow/gitflow-shFlags: No such file or directory
SilverFir-2:SRC mike$
It looks like it may just be a temporary connection issue (though it's unusual that you were able to manually get the submodule but the script couldn't do it). The make-less installer appeared to work fine on my Mac OS 10.8.3 system. The make-less installer isn't doing much, you can run the steps yourself to install it-
git clone https://github.com/nvie/gitflow.git
cd gitflow
git submodule init
git submodule update
sudo make install

Resources