Drutiny test module for Drupal failing with error: Drupal-8:PageCacheExpiry requires \Drutiny\Plugin\Drupal8\Audit\ConfigCheck - drupal

I am trying to run Drutiny like this from a Jenkins pipeline:
+ docker-compose exec -T cli ./vendor/bin/drutiny policy:audit Drupal-8:PageCacheExpiry #drupalvm.dev
fatal: not a git repository (or any of the parent directories): .git
In PolicySource.php line 24:
Drupal-8:PageCacheExpiry requires \Drutiny\Plugin\Drupal8\Audit\ConfigCheck
but is not available in this environment.
policy:audit [-p|--set-parameter [SET-PARAMETER]] [-r|--remediate] [-l|--uri [URI]] [--reporting-period-start [REPORTING-PERIOD-START]] [--reporting-period-end [REPORTING-PERIOD-END]] [--] <policy> <target>
Unfortunately this command from the Github-page errors out!
How can I debug this issue?

Related

java install issue error

I'm trying to install java. It looks that java is installed correctly, but when type java in cmd get this error. Could someone advise what this means?
C:\Users\Kamil>java Usage: java [options] [args...]
(to execute a class) or java [options] -jar [args...] (to execute a jar
file) or java [options] -m [/] [args...] java [options] --module [/]
[args...] (t`enter code here`o execute the main class in a module)
Arguments following the main class, -jar , -m or --module / are passed as
the arguments to main class.
where options include:
-d32 Deprecated, will be removed in a future release
-d64 Deprecated, will be removed in a future release
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
--class-path <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
<module name> can also be ALL-DEFAULT, ALL-SYSTEM,
ALL-MODULE-PATH.
--list-modules
list observable modules and exit
-d <module name>
--describe-module <module name>
describe a module and exit
--dry-run create VM and load main class but do not execute main method.
The --dry-run option may be useful for validating the
command-line options such as the module system configuration.
--validate-modules validate all modules and exit
The --validate-modules option may be useful for finding
conflicts and other errors with modules on the module path.
-D<name>=<value>
set a system property
-verbose:[class|module|gc|jni]
enable verbose output
-version print product version to the error stream and exit
--version print product version to the output stream and exit
-showversion print product version to the error stream and continue
--show-version
print product version to the output stream and continue
--show-module-resolution
show module resolution output during startup
-? -h -help
print this help message to the error stream
--help print this help message to the output stream
-X print help on extra options to the error stream

How to execute ssh command via robotframework

Can someone tell me what mistake i am doing in the following code , I am trying to run a shell command using robot framework and I have installed sshlibrary module using following command - pip install robotframework-sshlibrary . But still I am getting error that import SSHLibrary failed.My operating system is Ubuntu14.04.
Deploy.robot
*** Settings ***
Library SSHLibrary
Resource configuration.txt
*** Variables ***
${OBR_HOST} 10.110.72.192
${OBR_USERNAME} root
${OBR_PASSWORD} password
*** Test Cases ***
Deploy OBR machine code
${output}= Execute Command /root/deploy.sh
log to console ${\n}${output}
*** Keywords ***
open_connection_and_login
Open Connection ${OBR_HOST}
Login ${OBR_USERNAME} ${OBR_PASSWORD}
Execution Logs
root#92:~# pybot ssh-example.robot
[ ERROR ] Error in file '/root/ssh-example.robot': Importing test library 'SSHLibrary' failed: ImportError: Importing Paramiko library failed. Make sure you have Paramiko installed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/SSHLibrary/__init__.py", line 15, in <module>
from .library import SSHLibrary
File "/usr/local/lib/python2.7/dist-packages/SSHLibrary/library.py", line 22, in <module>
from .client import SSHClient
File "/usr/local/lib/python2.7/dist-packages/SSHLibrary/client.py", line 20, in <module>
from pythonclient import PythonSSHClient as SSHClient
File "/usr/local/lib/python2.7/dist-packages/SSHLibrary/pythonclient.py", line 21, in <module>
'Importing Paramiko library failed. '
PYTHONPATH:
/usr/local/bin
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/PILcompat
/usr/lib/python2.7/dist-packages/gtk-2.0
/usr/lib/python2.7/dist-packages/ubuntu-sso-client
==============================================================================
Ssh-Example
==============================================================================
Execute Deploy command | FAIL |
Parent suite setup failed:
No keyword with name 'Open Connection' found.
------------------------------------------------------------------------------
Ssh-Example | FAIL |
Suite setup failed:
No keyword with name 'Open Connection' found.
Also suite teardown failed:
No keyword with name 'Close All Connections' found.
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output: /root/output.xml
Log: /root/log.html
Report: /root/report.html
root#92:~# pip install robotframework-sshlibrary
Requirement already satisfied (use --upgrade to upgrade): robotframework-sshlibrary in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): robotframework in /usr/local/lib/python2.7/dist-packages (from robotframework-sshlibrary)
Requirement already satisfied (use --upgrade to upgrade): paramiko>=1.8.0 in /usr/local/lib/python2.7/dist-packages (from robotframework-sshlibrary)
Cleaning up...
Looks like your error happens in SSHLibrary/pythonclient.py before Robot Framework is involved. Try making a little Python script that imports Paramiko. Sometimes pip and pybot use different versions of Python. Try comparing output of head -n1 $(which pip) to head -n1 $(which pybot) to check that.
I had a very similar case:
Importing test library 'SSHLibrary' failed: ImportError: No module named 'SSHLibrary'
Thanks to #MarkHu I checked:
$ head -n1 $(which pip)
#!/usr/bin/python
and:
$ head -n1 $(which pybot)
#!/usr/bin/python3
One easy solution (from: https://pypi.org/project/robotframework/) is to use python to run "downgrade" the robot version also to 2.7 like this:
python -m robot test.robot

SonarQube MSBuild runner and scm root

good day
today i was setup sonarqube with ms build runner and mercurial scm provider
i have next structure of repository (schematic):
<ROOT>
-.hg
-src
----prj.infrastructure
----prj.domain
----prj.application
----prj.sln
and i used next command for run analysis:
"%env.SonarMsBuildRunner%\MSBuild.SonarQube.Runner" begin /n:prj /k:prj /v:1.0
"%env.MsBuildLocation%\msbuild" src\prj.sln /p:Configuration=Debug
"%env.SonarMsBuildRunner%\msbuild.sonarqube.runner" end
all analysis are work well, but scm not work (i see message like " Missing blame information for the following files:")
when i see generated sonar-project.properties i saw that problem is in projectBaseDir - it generates for each project in solution separately
i try to specify in command line like /d:sonar.projectBaseDir=... but no changes - it fully ignored
so my question is - can i use ms build runner and scm provider together with my repository structure?
UPDATE 1
i awas added verbose flag to my script..
now i run analysis with next command:
MSBuild.SonarQube.Runner begin /n:projectName /k:projectKey /v:1.0 /d:sonar.scm.enabled=true /d:sonar.scm.provider=hg /d:sonar.projectBaseDir=d:\work\project1 /d:sonar.verbose=true
msbuild project1\src\solution.sln /p:Configuration=Debug
msbuild.sonarqube.runner end
in log i can see this messages:
[14:18:20] : [Step 4/4] 14:18:20.403 DEBUG: Working directory: D:\work\project1\src\
[14:18:20] : [Step 4/4] 14:18:20.416 DEBUG: Executing: hg blame -w -v --user --date --changeset API/AssignmentsController.cs
[14:18:20] : [Step 4/4] 14:18:20.423 DEBUG: Executing: hg blame -w -v --user --date --changeset API/Commands/ImportCommand.cs
[14:18:20] : [Step 4/4] 14:18:20.424 DEBUG: Executing: hg blame -w -v --user --date --changeset API/Dto/Assignment.cs
[14:18:20] : [Step 4/4] 14:18:20.600 DEBUG: The mercurial blame command [hg blame -w -v --user --date --changeset API/AssignmentsController.cs] failed: abort: no repository found in 'D:\work\project1\src\' (.hg not found)!
[14:18:20] : [Step 4/4]
and this is right - in folder d:\work\project1\src no .hg directory, because it's place in d:\work\project1
UPDATE2
ok, finally i find than i my mistake... on build machine folder .hg missed by some reasons...
This is a limitation of the SonarQube Mercurial Plugin. It currently expects to find the .hg folder precisely in the basedir. Other plugins like SVN where updated to look recursively in parent folders.
We are no more actively developing the Mercurial plugin, but feel free to submit a pull request to fix the issue.
As a workaround, you can force the SCM using /d:sonar.scm.provider=hg in the begin step.

Could not find function xmlCheckVersion in library libxml2 during Scrapy install

I've been looking through endless forums trying to solve this and I still haven't found an answer that works. I'm new to windows and I'm trying to set things up as I have them on my Mac but the Command Line is presented challenges (what's the equivalent to sudo?) eg, on mac I would type 'sudo pip install scrapy', what's the equivalent on windows? I'm getting this error below and I cannot seem to find my way around it. Any thoughts greatly appreciated.
C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\includes -Ic:\python27\include -Ic:\python27\PC /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win32-2.7\Release\src\lxml\lxml.etree.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Users\\kenma\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
creating users
creating users\kenma
creating users\kenma\appdata
creating users\kenma\appdata\local
creating users\kenma\appdata\local\temp
C:\Users\kenma\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /Tcc:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.c /Fousers\kenma\appdata\local\temp\xmlXPathInitdw65bp.obj
xmlXPathInitdw65bp.c
c:\users\kenma\appdata\local\temp\xmlXPathInitdw65bp.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Users\\kenma\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\kenma\\appdata\\local\\temp\\pip-build-c6lrhk\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\kenma\appdata\local\temp\pip-vhli1l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\kenma\appdata\local\temp\pip-build-c6lrhk\lxml\
This seems to be related to lxml installation which is a scrapy dependency.
The official documentation page has some solutions but it recommends to use unofficial binaries for windows operating system which can be found here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

Python setup.py egg_info failed with error code 1 at pip install psycopg2

[root#Nav15 nav15]# pip install psycopg2
Collecting psycopg2
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached psycopg2-2.6.2.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
/tmp/pip-build-Fh_XN3/psycopg2/setup.py:12: DeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Fh_XN3/psycopg2

Resources