Groovy script stuck on "Resolving dependency" - http

I'm trying to run a simple groovy script for HTTP requests.
Using this dependecy:
#Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
Running from command line with this:
groovy -Dgroovy.grape.report.downloads=true script.groovy
I get this output:
Resolving dependency: org.codehaus.groovy.modules.http-builder#http-builder;0.7.1 {default=[default]}
And nothing else.
Groovy version:
Groovy Version: 2.3.6 JVM: 1.7.0_80 Vendor: Oracle Corporation OS: Linux

Related

Setting up Apache Atlas

I am trying to setup Apache Atlas on my Windows 10 machine. I have the following prereqs:
Maven Version 3.8.6
JDK Version 1.8.0
Python 2.7.7
I then pull Apache Atlas and I am using tags/release-2.3.0. Once downloaded, I run the following commands in Powershell:
set MAVEN_OPTS="-Xms2g -Xmx2g
mvn clean install
This starts running a set of tests, which fail. I get the following error:
in org.apache.atlas.kafka.KafkaNotificationTest [ERROR]
org.apache.atlas.kafka.KafkaNotificationTest.testReceiveKafkaMessages
Time elapsed: 8.178 s <<< FAILURE! java.lang.NoClassDefFoundError:
org/apache/atlas/kafka/AtlasKafkaMessage
at org.apache.atlas.kafka.KafkaNotificationTest.testReceiveKafkaMessages(KafkaNotificationTest.java:63)
Caused by: java.lang.ClassNotFoundException:
org.apache.atlas.kafka.AtlasKafkaMessage
at org.apache.atlas.kafka.KafkaNotificationTest.testReceiveKafkaMessages(KafkaNotificationTest.java:63)
How can I resolve this issue to install Atlas?

Error - Expected ';' while running Gatling using sbt

I am running a Gatling test script using Jenkins on a Unix machine. The test and the Simulation passes successfully after which I am seeing the below error marked in bold below also causing the Jenkins build to fail.
Log from the Jenkins build
Reports generated in 0s.
Please open the following file: >/var/lib/jenkins/workspace/gatling_test_job/target/gatling/demoscript-20200930173820423/index.html
[info] Simulation DemoScript successful.
[info] Simulation(s) execution ended.
[success] Total time: 326 s (05:26), completed Sep 30, 2020 5:43:32 PM
>[error] Expected ';'
[error] com.test.performance.DemoScript
[error] ^
Build step 'Build using sbt' changed build result to FAILURE
Build step 'Build using sbt' marked build as failure
I am using build using sbt block in my Jenkins job to trigger the test using the below command
gatling:testOnly com.test.performance.DemoScript
Scala Version is - 2.12.10
Gatling and related libraries - 3.3.1
Build using sbt config in Jenkins
sbt installation in global tool configuration

Pivotal .NetCore 3.1 dotnet-runtime Error During Deployment

I want to deploy my project using Pivotal from Bamboo. During the deployment of my .NetCore 3.1 project, I'm getting the error "Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install". The deployment stack is set to cflinuxfs3.
I've tried specifying dotnet runtime version (3.1 and 3.1.5) in .csproj file but it got the same error so I removed it.
I've also created a buildpack.yml file and specified the .netcore sdk version as 3.1.x in there.
I'm sharing the property group from csproj and the manifest.yml file.
-- Error Log --
Downloading app package...
Downloaded app package (6.4M)
-----> Dotnet-Core Buildpack version 2.3.12
-----> Supplying Dotnet Core
-----> Installing libunwind 1.4.0
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/a54cfafce3d2a14e4f96777d5fd471f4/libunwind_1.4.0_linux_noarch_cflinuxfs3_05e08b22.tgz]
using the default SDK
-----> Installing dotnet-sdk 3.1.301
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/b422801667458a262ba26a3117b93e4f/dotnet-sdk_3.1.301_linux_x64_any-stack_80a771e4.tar.xz]
-----> Installing dotnet-runtime 3.1.5
Copy[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/40b5a460524fe7f1795c876445349a31/dotnet-runtime_3.1.5_linux_x64_any-stack_1aa84612.tar.xz]
-----> Finalizing Dotnet Core
ERROR Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install Failed to compile droplet: Failed to
run finalize script: exit status 12 Exit status 223 Cell
ffe536bc-374c-46b5-a620-e3366dab6b22 stopping instance
b71ecb48-0083-4fd1-8f59-3a77b05de0e0
Error staging application: App staging failed in the buildpack compile
phase
-- .csproj --
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
-- manifest.yml --
---
applications:
- name: projectName
memory: 1G
timeout: 240
instances: 1
routes:
- route: routeAddress
services:
- ARCHITECTURE.SERVICES-TST.ServiceRegistry
- ProjectName.Redis
- ProjectName.Dynatrace
- ProjectName.ConfigServer
env:
DT_TAGS: ((appName)) ((dc))-((env))
TZ: country
ASPNETCORE_ENVIRONMENT: environmentName
SPRING_CLOUD_CONFIG_LABEL: configLabel
Ok, here's what is happening.
The code is looking at the RuntimeFrameworkVersion in your .csproj file.
When that is empty, it's going to look at the TargetFramework and attempt to find a substring match using the regex netcoreapp(.*).
It is expecting that to have a single match, but in your case it does not, so you get that error message: could not find a version of dotnet-runtime to install.
Based on your .csproj file, it seems like what you have should be OK though. I did a quick check and the regex works and returns the version.
You could try setting RuntimeFrameworkVersion which would take a slightly different code path and might work for you.
You are trying to perform a source-based deployment. You could try dotnet publish first followed by a Framework Dependent Deployment which again would force a different code path.
It might be that the buildpack isn't finding your file, but it's hard to say without more info.

dotnet publish "Unable to load the service index for source https://api.nuget.org/v3/index.json"

I am getting the error message
Unable to load the service index for source https://api.nuget.org/v3/index.json'
on executing dotnet publish. dotnet restore is working fine with leveraging a local NuGet repository (Artifactory). The system I am running this on has no internet connection. But why does dotnet publish reach out to nuget.org? And is there a way to prevent this happening?
D:\tools\dotnet\dotnet.exe publish proj.sln --configuration Release --output bin/Release/PublishOutput
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json[D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : An error occurred while sending the request. [D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : The operation timed out [D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
My .NET enviroment
dotnet --info
.NET Command Line Tools (2.0.0)
Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9
Runtime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64
Base Path: D:\tools\dotnet\sdk\2.0.0\
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
Updating to 2.0.5 solved this.

Selenium test with behat and mink in symfony 3 on vagrant virtual machine

I have symfony 3.2.6 app. I have some buttons that make ajax calls so I need to test them with selenium. I installed and configured behat and mink. With standard functional tests without javascript everything works fine.
I have my context class that extends MinkContext.
My feature file have #javascript tag on top of test. In my virtual machine in /var/www/selenium folder I run selenium server with this command:
DISPLAY=:1 xvfb-run java -jar selenium-server-standalone-3.3.1.jar
This is my behat.yml
extensions:
Behat\Symfony2Extension: ~
Behat\MinkExtension:
goutte: ~
selenium2:
wd_host: http://myapp.dev:4444/wd/hub
base_url: http://myapp.dev
javascript_session: selenium2
browser_name: firefox
When I run
php vendor/bin/behat --tags #javascript
I get this error:
Could not open connection: Cannot find firefox binary version '9' in PATH
Build info: version: '3.3.1', revision: '5234b32'
And if I change browser_name: safari I get this:
Could not open connection: The best matching driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver can't create a new driver instance for Capabilities [{deviceType=tablet, selenium-version=2.31.0, marionette=false, browserVersion=9, browser=firefox, name=Behat feature suite, browserName=safari, deviceOrientation=portrait, ignoreZoomSetting=false, version=9, platform=ANY, tags=[myapp.puphpet, PHP 7.0.18]}]
I installed xorg-x11-server-Xvfb, java-1.8.0-openjdk.x86_64, http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar and firefox.
Did I missed any step?
EDIT:
I run this command:
yum -y install firefox Xvfb libXfont Xorg
and also this one:
yum -y groupinstall "X Window System" "Desktop" "Fonts" "General Purpose Desktop"
I downloaded selenium 2.53.1. If I run startx I get this error:
(gnome-panel:15453): Gtk-WARNING **: A floating object was finalized. This means that someone
called g_object_unref() on an object that had only a floating
reference; the initial floating reference is not owned by anyone
and must be removed with g_object_ref_sink().
When I run
nohup java -jar selenium-server-standalone-2.53.1.jar
I get
nohup: ignoring input and appending output to `nohup.out'
If I run
DISPLAY=:1 xvfb-run java -jar selenium-server-standalone-2.53.1.jar
I get
Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
09:22:37.189 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
09:22:37.190 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
09:25:11.183 INFO - Selenium Server is up and running
I tried with ff 52.1.0-2, 45.8.0-2 and 45.7.0-2.
And if I run behat test while selenium server is running I get
Could not open connection: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
You need to use JAR version 2.53, see my article for more details:
https://alvinbunk.wordpress.com/2016/08/03/using-mink-to-perform-functional-tests-in-symfony3-framework/
The older JAR supports the older versions of FireFox on Linux.
Here's the link to the 2.53.1 JAR you will need:
https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
EDIT #2 based on comments
Make sure you run this in another console:
export DISPLAY=:1
This is because you are running:
DISPLAY=:1 xvfb-run java -jar selenium-server-standalone-2.53.1.jar

Resources