Hygieia - Creation of dashboard is failing - mongodb

I'm working no setting up Hygieia dashboard.
Hygieia: https://github.com/gigaaks/Hygieia
Trying both approaches of setting it up locally or using Docker based installation/setup.
I'm successfully able to get mongoDB, it's API, UI modules up and running. Hygieia main login screen comes up fine. I successfully created the login user and able to log in.
At this point, I have mongoDB running, API, UI pieces running and it's time to create a CAP One / Split Dashboard (templates provided by Hygieia). When I provide the values for creating a new dashboard, it's throwing the following error in the API logs on the server (vagrant/VirtualBox instance) OR within the Docker's container.
What I found was there are lots of issues in this project's module where things are not correct i.e. database name in one module is dashboard, in other module it's dashboardb and in other, it's expecting dashboarddb. I fixed those issues in my github repo/project and initiated a pull request which is approved and will be merged. The following error though, tells my that Hygieia's UI piece is NOT sending a parameter what the API piece is expecting while trying to create a dashboard (in mongoDB). The parameter is "type" and as UI (Hygieia GUI) is not sending it (as per their latest code in GitHUB), the API is failing throwing an error saying that type variable value is passed as NULL. I found the same when I tried POST operation by sending the same JSON RestAPI query using Postman.
Due to this, I'm currently not able to create a dashboard and start using the collectors provided by Hygieia out of the box (for Stash, GitHub, Jenkins, SonarQube etc).
Has anyone of you have faced or found a workaround for this error/issue?
2016-04-01 02:40:40,357 WARN c.c.d.rest.RestApiExceptionHandler - Bad Request - bind exception:
org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'dashboardRequest' on field 'type': rejected value [null]; codes dashboardRequest.type,NotNull.type,NotNull.java.lang.String,NotNull]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [dashboardRequest.type,type]; arguments []; default message [type]]; default message [may not be null]
at com.capitalone.dashboard.rest.RestApiExceptionHandler.handleMethodArgumentNotValid(RestApiExceptionHandler.java:55) [api.jar!/:2.0.0-SNAPSHOT]
at org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler.handleException(ResponseEntityExceptionHandler.java:156) [spring-webmvc-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_72-internal]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_72-internal]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_72-internal]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_72-internal]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) [spring-web-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) [spring-web-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) [spring-webmvc-4.1.7.RELEASE.jar!/:4.1.7.RELEASE]

The issue was coming due to that fact that I used Hygieia modules docker images built locally using Maven (mvn clean install ; mvn docker:build) but for the UI module, as I was getting an error message, I cherry picked that image from captial one/hygieia-ui image. For some reason, it didn't work and was showing the above error (as there could be API level changes).
I had to run the following to get Hygieia dashboard up and running in local machine:
git config --global --unset-all url.https
git config --global url."https://".insteadOf git://
npm config set prefix /usr/local
sudo npm install --color=false; sudo npm install -g bower gulp; sudo npm install bower install
mvn clean install; mvn docker:build
gulp serve
Now, everything is working as expected for creating dashboard (PS: You have to create mongo db database first using mongo command line as shows in Hygieia's documentation).
npm -g option will install bower and gulp globally. without -g, it'll also install the same locally. Global values actually refer the local values.
For docker based solution, I just used docker-comopose file and got it up and running.
NodeJS(node) version: v5.10.0
NPM (Node pkg mgr) : 3.8.3
Bower version : 1.7.9
Gulp version : [08:18:42] CLI version 3.9.1,[08:18:42] Local version 3.9.1,
Maven version : Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
Java version :

Related

Cannot import jdl file using jhipster

I'm new to jhipster. I am on jhipster v7.8.1, i can generate an app using the cli questions but when i try importing a jdl file i got the following error:
**ERROR! Class constructor GAstVisitor cannot be invoked without 'new'
TypeError: Class constructor GAstVisitor cannot be invoked without 'new'
at new DslMethodsCollectorVisitor
This occurs due to a recent bug in the one of JHipster libraries. As a temporary solution you can go to the JHipster installed location and find it's package.json file and override the package causing this error as follows. Then run npm install again.
"overrides":{
"chevrotain#10.1.2": {
"#chevrotain/gast": "10.1.2"
}
}
This will prevent the JHipster using latest package of that.
I experienced the same error and managed to get the JDL file to run by using version 7.8.1
I followed the following steps to get this done;
uninstall the current version of jhipster that is causing issues for
my case this was 7.9.2 . use this command npm uninstall -g
generator-jhipster
Install version 7.8.1 using this command npm
install -g generator-jhipster#7.8.1
Attempt to run your JDL using
this command jhipster jdl jhipster-jdl.jdl
At this stage, your JDL
will be able to run

I get this error running PMD from salesforce CLI, "ERROR running scanner:run: Attempted to resolve unregistered dependency token: "RuleManager""

Can anyone help me with this. Im using Mac. I cant find the location of the rulemanager. Please see error below
Lxxxxxxx:pmd-bin-6.34.0 xxxxxx$ sfdx scanner:run pmd --target /usr/src --category rulesets/java/quickstart.xml -f sarif
(node:17810) [editions-autoloader-none-broadened] Error Plugin: sfdx-cli: editions-autoloader-none-broadened: Unable to determine a suitable edition, even after broadening.
module: #oclif/config#1.17.0
task: runHook init
plugin: sfdx-cli
root: /Users/xxxxxxx/.local/share/sfdx/client/7.100.0-9d243d8
See more details with DEBUG=*
(Use node --trace-warnings ... to show where the warning was created)
ERROR running scanner:run: Attempted to resolve unregistered dependency token: "RuleManager"
Kieran, this is an issue that we just discovered. It is related to an incompatibility with the version of Node.js that is bundled with the Salesforce CLI and a library that is used by sfdx-scanner.
A temporary workaround can be found at https://github.com/forcedotcom/sfdx-scanner/issues/412
You will need to use the npm installation instead of the pkg installer since you are interested in the Sarif output. Sarif output was added in version 2.6.0. The issue affects versions 2.6.0-2.8.0 when using the pkg installer on a Mac.
We hope to have a fix rolled out in the next couple of days. I will post here when version 2.9 has been released. Sorry for any inconvenience.
Kieran, this issue has been fixed in version 2.9.1. You can upgrade by executing the following commands in your shell.
sfdx plugins:uninstall #salesforce/sfdx-scanner
sfdx plugins:install #salesforce/sfdx-scanner

Haskell and postgresql - build error "The program pg_config is required but it could not be found."

I am currently learning haskell and just tried using postgresql as a database.
I generated my project with stack (stack new <name> -> stack setup -> stack build)
and then all I changed was adding the dependencies needed to persistent and postgresql to the
package.yaml file (under "dependencies:").
These are:
persistent
persistent-postgresql
persistent-template
This however results in a failing build with the following message:
postgresql-libpq > setup.exe: The program 'pg_config' is required but it could not be found.
postgresql-libpq >
-- While building package postgresql-libpq-0.9.4.2 using:
C:\Users\\AppData\Local\Temp\stack14388\postgresql-libpq-0.9.4.2.stack-work\dist\e626a42b\setup\setup --builddir=.stack-work\dist\e626a42b configure --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\365a3dde\pkgdb --libdir=C:\sr\snapshots\365a3dde\lib --bindir=C:\sr\snapshots\365a3dde\bin --datadir=C:\sr\snapshots\365a3dde\share --libexecdir=C:\sr\snapshots\365a3dde\libexec --sysconfdir=C:\sr\snapshots\365a3dde\etc --docdir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --htmldir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --haddockdir=C:\sr\snapshots\365a3dde\doc\postgresql-libpq-0.9.4.2 --dependency=Cabal=Cabal-2.4.1.0-5rQrtDcYhR2LOcYye7obEr --dependency=Win32=Win32-2.6.1.0 --dependency=base=base-4.12.0.0 --dependency=bytestring=bytestring-0.10.8.2 -f-use-pkg-config --extra-include-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\include --extra-lib-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\lib --extra-lib-dirs=C:\Users\\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531\mingw64\bin --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
Does anyone know how to resolve this issue and why it even occurs?
Do I have to install postgresql just for being able to run build the project? If so, how would you
do this in production, when the database could basically lie everywhere?
It looks like Haskell is trying to build with the PostgreSQL client shared library libpq.dll and uses pg_config at build time to determine where PostgreSQL is installed and how it was built.
That would mean that you have to install PostgreSQL on the machine where you build Haskell, including the header files, build environment or however it is called by the installer.
For running Haskell you would only need libpq.dll and the dependent shared libraries.
I solved the issue in Ubuntu with the following command:
apt install libpq-dev

Gcloud app deploy failing with mongo-driver because of DataDog/zstd

I have been using mongo-driver in my project, deploying with gcloud app deploy for a while now. I recently rebuild my machine, and simply ran go get to get fetch ally my dependencies. Everything is compiling fine locally, however, gcloud app deploy fails:
Failed to build app: building app with command '[go build -o /tmp/staging/usr/local/bin/start ***\admin]', env '[PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=***HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GOPATH=/tmp/staging/srv/gopath]': err=exit status 1, out=srv/gopath/src/go.mongodb.org/mongo-driver/x/mongo/driver/compression_cgo.go:15:2: cannot find package "github.com/DataDog/zstd" in any of:
/tmp/staging/srv/gopath/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd (vendor tree)
/usr/local/go/src/github.com/DataDog/zstd (from $GOROOT)
/tmp/staging/srv/gopath/src/github.com/DataDog/zstd (from $GOPATH).
Any ideas? app.yaml is just runtime: go113
Have you tried specifying dependencies with go mod yet?
I faced the same issue and finally can solved by generating go.mod file with these command,
GO111MODULE=on go mod init
GO111MODULE=on go mod tidy
Here is the details explanation.

How to avoid Edeliver deployment error: "vm.args: No such file or directory"?

Context
We are trying to use edeliver to deploy a "Hot Upgrade" of a Phoenix Web Application to a remote Virtual Machine instance.
Our aim is to build an "upgrade" version of the app each time so that the app can be "hot" upgraded in production without any down-time.
We have succeeded in doing this "hot upgrade" on a "Hello World" phoenix app:
https://github.com/nelsonic/hello_world_edeliver which is automatically deployed from Travis-CI when the build passes. see: https://travis-ci.org/nelsonic/hello_world_edeliver/builds/259965752#L1752
So, in theory this technique should work for our "real" app.
Attempting to Deploy a "Real" Phoenix App using Edeliver
Ran the following command (to build the upgrade):
mix edeliver build upgrade --auto-version=git-revision --from=$(git rev-parse HEAD~) --to=$(git rev-parse HEAD) --verbose
i.e. "build the upgrade from the previous git revision to the current one"
So far, so good. "Release successfully built!"
Error: vm.args: No such file or directory
When we attempt to deploy the upgrade:
mix edeliver deploy upgrade to production --version=1.0.3+86d55eb --verbose
cat: /home/hladmin/healthlocker/releases/1.0.3+86d55eb/vm.args: No such file or directory
Note: we have a little bash script that reads the latest upgrade version available in .deliver/releases and deploys that see: version.sh
Question:
Is there a way to ignore the absence of the vm.args file and continue the deployment?
Or if the file is required to complete the deployment, is there some documentation on how to create the file?
Note: we have read the distillery "Runtime Configuration" docs: https://github.com/bitwalker/distillery/blob/master/docs/Runtime%20Configuration.md and are sadly none-the-wiser ...
Additional Info
Environment
Localhost: Mac running Elixir 1.4.2
Build Host: Ubuntu 16.04.2 LTS running Elixir 1.4.5
mix.exs file: https://github.com/healthlocker/healthlocker/blob/continuous-delivery/mix.exs
edeliver version: 1.4.4
Build tool: distillery version: 1.4.0
Umbrella project: yes.
This question was also asked on: https://github.com/edeliver/edeliver/issues/234
As mentioned by others, the vm.args file is necessary for BEAM to run the release. A default file is created by distillery during the release build process and should be located in releases/<version>/vm.args. From your log output it looks like expected directory is being checked.
Can you show us the contents of /home/hladmin/healthlocker/releases/?
Can you confirm that the default vm.args file is being created when building the release and extracting it (outside of the upgrade process)?
You also asked:
Or if the file is required to complete the deployment, is there some documentation on how to create the file?
If diagnosing the problem with the default vm.args file doesn't get you anywhere, you can also write your own file and configure distillery to use that file instead of the default. The details for this are in the distillery configuration docs. In short,
add the vm_args setting to your distillery config, which should be at rel/config.exs(relative to your project root), for example:
environment :prod do
set vm_args: "<path>/vm.args"
[...]
end