PowerShell DSC resource MSFT_PackageResource failed: The return code 1618 was not expected. Configuration is likely not correct - windows

I have exe file downloaded in the VM in specific folder, I am trying to install Adobe using Powershell dsc code.
Script is failing with below error during execution (Configuration is called through ARM template), however if I check inside the VM, adobe is installed.
Tried running the same script manually inside the VM. Not facing any error though.
[{"code":"VMExtensionProvisioningError","message":"VM has reported a failure when processing extension 'configureWindowsServer'. Error message: "DSC Configuration 'Adobe' completed with error(s). Following are the first few: PowerShell DSC resource MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: The return code 1618 was not expected. Configuration is likely not correct The SendConfigurationApply function did not succeed."\r\n\r\nMore information on troubleshooting is available at https://aka.ms/VMExtensionDSCWindowsTroubleshoot "}]}
Configuration Adobe
{
$PackagesFolder = "C:\Packages\Adobe"
$AcrobatReader = #{
"Name" = "Adobe Acrobat Reader DC"
"ProductId" = "XXXXXX-XXXXX-XXXXXXX"
"Installer" = "AcroRdrDC.exe"
"FileHash" = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
"HashAlgorithm" = "SHA256"
"DestinationPath" = "$PackagesFolder\AdobeAcrobatReaderDC"
"Arguments" = "/msi EULA_ACCEPT=YES /qn"
}
Package AdobeAcrobatReaderDC {
Ensure = "Present"
Name = $AcrobatReader.Name
ProductId = $AcrobatReader.ProductId
Path = ("{0}\{1}" -f $AcrobatReader.DestinationPath, $AcrobatReader.Installer)
Arguments = $AcrobatReader.Arguments
}
}

Related

Getting error after entering a value in a text box in karate UI via Firefox

This issue is only when I invoke the scripts via firefox driver, after entering value in a text box getting an error and test is failing
configure driver = {type:'geckodriver' , executable:'C:\Users\dinesh\Downloads\geckodriver-v0.31.0-win64\geckodriver.exe'}
driver 'https://courses.ultimateqa.com/users/sign_in'
screenshot()
driver.maximize()
input("//*[#id='user[email]']","abc#gmail.com")
Error message
* input("//*[#id='user[first_name]']", 'welcome')
js failed:
>>>>
01: input("//*[#id='user[first_name]']", 'welcome')
<<<<
org.graalvm.polyglot.PolyglotException: Expected to find an object with property ['message'] in path $['value'] but found 'null'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
- com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:71)
- com.jayway.jsonpath.internal.path.PathToken.handleObjectProperty(PathToken.java:81)
- com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:79)
- com.jayway.jsonpath.internal.path.RootPathToken.evaluate(RootPathToken.java:62)
- com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:99)
- com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:107)
- com.jayway.jsonpath.JsonPath.read(JsonPath.java:185)
Please help me the xpath is right, karate is writing the value in text box but after that it is failing
For me this code works, both with chromedriver and geckodriver. Of course these executables must be set in the PATH environment variable.
I added also the waitFor method to wait for the web element.
Feature: sample karate test script
for help, see: https://github.com/intuit/karate/wiki/IDE-Support
Background:
#* configure driver = { type: 'chromedriver', executable: 'chromedriver' }
* configure driver = { type: 'geckodriver', executable: 'geckodriver' }
#* def sleep = function(pause){ java.lang.Thread.sleep(pause) }
Scenario: test error
Given driver 'https://courses.ultimateqa.com/users/sign_in'
When waitFor("//*[#id='user[email]']").input('abc#gmail.com')
And waitFor("//*[#id='user[password]']").input('qwerty1234')
And waitFor("//input[#type='submit']").click()
* screenshot()
#* call sleep 3000

'No such file or directory' error when using buildGoPackage in nix

I'm trying to build the hasura cli: https://github.com/hasura/graphql-engine/tree/master/cli with the following code (deps derived from dep2nix):
{ buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
version = "1.0.0-beta.2";
name = "hasura-${version}";
goPackagePath = "github.com/hasura/graphql-engine";
subPackages = [ "cli" ];
src = fetchFromGitHub {
owner = "hasura";
repo = "graphql-engine";
rev = "v${version}";
sha256 = "1b40s41idkp1nyb9ygxgsvrwv8rsll6dnwrifpn25bvnfk8idafr";
};
goDeps = ./deps.nix;
}
but I get the following errors after the post-installation fixup step:
find: '/nix/store/gkck68cm2z9k1qxgmh350pq3kwsbyn8q-hasura-cli-1.0.0-beta.2': No such file or directory.
What am I doing wrong here? For reference, I'm on macOS and using home-manager.
For anyone still wondering:
There are a couple of things to consider:
dep has been deprecated in favor of go modules
This is also reflected in Nix, as buildGoPackage is now legacy and moved to buildGoModule
There is already a hasura-cli package in nixpkgs. You can just use it with nix-shell -p hasura-cli

cctools-binutils-darwin/bin/ranlib failed, malformed object (unknown load command)

I am attempting to build the gitlib-libgit2 Haskell package on macos via nix in roughly the following manner.
mkdir nix-repro && cd nix-repro
cabal2nix --no-check cabal://gitlib-libgit2 > gitlib-libgit2.nix
echo '(import <nixpkgs> {}).haskellPackages.callPackage ./gitlib-libgit2.nix {}' > default.nix
nix-build
I am seeing the following warnings and error:
ld: warning: /nix/store/spx9xz1jv3yhmqw8y3agki1fvdr2x2fv-libiconv-osx-10.11.6/lib/libiconv.dylib, ignoring unexpected dylib file
ld: warning: /nix/store/spx9xz1jv3yhmqw8y3agki1fvdr2x2fv-libiconv-osx-10.11.6/lib/libiconv.dylib, ignoring unexpected dylib file
/nix/store/s33984hx2gwcg2d4dgpcm4342md19qvh-cctools-binutils-darwin/bin/ranlib: object: dist/build/libHSgitlib-libgit2-3.1.2.1-1fYQZMedHRP3aXiBXJFDO2-ghc8.6.3.a(s2_meth.o) malformed object (unknown load command 1)
`ranlib' failed in phase `Ranlib'. (Exit code: 1)
builder for '/nix/store/yrran1p69pvdq1b34jqfq7dmd95j9fh9-gitlib-libgit2-3.1.2.1.drv' failed with exit code 1
error: build of '/nix/store/yrran1p69pvdq1b34jqfq7dmd95j9fh9-gitlib-libgit2-3.1.2.1.drv' failed
What does this mean, and how can I go about fixing it?
It only fails this way on macos, as far as I can tell. I'm on nixpkgs-unstable. I am able to build this package using other tools, so the failure must be something specific to the nix tooling I'm using to build it.
$ cat $HOME/.nix-defexpr/channels/nixpkgs/.git-revision
6e5caa3f8ac48750233ef82a94825be238940825
Here's the full gitlib-libgit2.nix expression if you don't want to run cabal2nix for yourself:
{ mkDerivation, base, bytestring, conduit, conduit-combinators
, containers, directory, exceptions, fast-logger, filepath, gitlib
, gitlib-test, hlibgit2, hspec, hspec-expectations, HUnit, mmorph
, monad-loops, mtl, resourcet, stdenv, stm, stm-conduit, tagged
, template-haskell, text, text-icu, time, transformers
, transformers-base, unliftio, unliftio-core
}:
mkDerivation {
pname = "gitlib-libgit2";
version = "3.1.2.1";
sha256 = "b90e0ad2e7e0f58379e02cbe60d2900c95f0a255c34bd3461f8ee5753a6aa23e";
libraryHaskellDepends = [
base bytestring conduit conduit-combinators containers directory
exceptions fast-logger filepath gitlib hlibgit2 mmorph monad-loops
mtl resourcet stm stm-conduit tagged template-haskell text text-icu
time transformers transformers-base unliftio unliftio-core
];
testHaskellDepends = [
base exceptions gitlib gitlib-test hspec hspec-expectations HUnit
transformers
];
doCheck = false;
description = "Libgit2 backend for gitlib";
license = stdenv.lib.licenses.mit;
}

NativeScript when adding custom resource/json files

I am creating a project to target Android and in it, I want it to come with a .json file from which some data will be loaded.
I put my .json file into the Android folder. When running "tns run android --device 1" (which is my physical device) I get:
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Found new input file
[aapt] Generating resource IDs...
[aapt] invalid resource directory name: /Users/konrad/Desktop/NativeScript/hello-world/platforms/android/res res
[aapt] invalid resource directory name: /Users/konrad/Desktop/NativeScript/hello-world/platforms/android/res small.json
BUILD FAILED
/usr/local/Cellar/android-sdk/24.3.3/tools/ant/build.xml:649: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/24.3.3/tools/ant/build.xml:694: null returned: 1
Total time: 0 seconds
Command ant failed with exit code 1
The file is called small.json
EDIT: Even if I remove the file, the problem still remains.
The property of Android is that it restricts access to some parts of the file system. There are two ways of accessing files on NativeScript for Android:
1) JavaScript way
var fs = require('file-system');
var documents = fs.knownFolders.documents();
var myFile = documents.getFile(filename);
as specified in the docs: https://github.com/NativeScript/docs/blob/master/ApiReference/file-system/HOW-TO.md
2) Android specific way including a third party library called "json-simple" which needs to be attached using the command tns library add android .
var context = app.android.context;
var assets = context.getAssets();
var br = new java.io.BufferedReader(new java.io.InputStreamReader(assets.open(filename)));
var parser = new org.json.simple.parser.JSONParser();
try {
parser.parse(br);
} catch (ex) {
var javaEx = ex.nativeException;
var msg = javaEx.getMessage();
console.log("whops! : "+msg);
}

how to set path, when repo is downloaded using gradle

I am using gradle to download the selenium chrome driver from maven
webtestsCompile 'org.seleniumhq.selenium:selenium-chrome-driver:2.32.0'
I am trying to use this directly and I see that I get this error :
Caused by:
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromedriver/downloads/list
I have looked up a couple of questions from stack-overflow and other places it requires me to set the value of the property webdriver.chrome.driver to the location where I have downloaded with some-thing like this :
System.setProperty("webdriver.chrome.driver", "path to chrome-driver");
I am wondering what is the best way to go about this ?
EDIT 1:
I verified the java.class.path a snippet of this path looks like this :
/home/bhavya/.gradle/caches/artifacts-26/filestore/org.seleniumhq.selenium/selenium-chrome-driver/2.32.0/jar/14a4e8e32a4129c682c67381f5d7bf11f2327e1/selenium-chrome-driver-2.32.0.jar
This looks like the selenium-chrome-driver is present in the java.class.path.
Edit 2 :
I would want the chrome driver to work irrespective of the operating system that I am using, currently I am on a ubuntu box but a lot of this will get tested on a windows box. When I hard coded the value of the webdriver.chrome.driver to the value in EDIT 1, I am facing the following issue :
java.lang.IllegalStateException: The driver is not executable: /home/bhavya/.gradle/caches/artifacts-26/filestore/org.seleniumhq.selenium/selenium-chrome-driver/2.32.0/jar/14a4e8e32a4129c682c67381f5d7bf11f2327e1/selenium-chrome-driver-2.32.0.jar
Edit 3 :
Task within which I am running the test suite --
task webs(type: Test, dependsOn: updateNodeModules) {
testClassesDir = sourceSets.webtests.output.classesDir
classpath = sourceSets.webtests.runtimeClasspath
def javaHomeBin = new File(System.getProperty("java.home"), "bin");
def javaExec = new File(javaHomeBin, "java").getAbsolutePath();
systemProperties['jar.path'] = jar.archivePath
if(project.hasProperty('url')){
println" url passed as variable is $url"
systemProperties["selenium.webdriver.url"] = "$url"
}
systemProperties["selenium.webbrowser.type"] = "firefox"
if(project.hasProperty('browser')){
println "the browser passed is $browser"
systemProperties["selenium.webbrowser.type"] = "$browser"
}
include '**/UserEditControllerWebTest.class'
doFirst {
println " iterator is $it"
def chrome=configurations.testRuntime.find {
it.name.contains("selenium-chrome-driver")
}.path
println " chrome driver path is $chrome"
systemProperties["webdriver.chrome.driver"]= "$chrome"
}
}
Assuming that you need to set this system property for your tests, you can do something like:
test.doFirst {
systemProperty "webdriver.chrome.driver",
classpath.find {
it.name.contains("selenium-chrome-driver")
}.path
}

Resources