testcontainers-go: p.client.DaemonHost undefined - docker

I am trying to add TestContainers-Go to my project. I use glide and TestNginxLatestReturn example from Github readme file.
In glide I put
- package: github.com/testcontainers/testcontainers-go
version: v0.0.3
but at runtime I get this error in IDEA.
# github.com/testcontainers/testcontainers-go
../../../../../../pkg/mod/github.com/testcontainers/testcontainers-go#v0.0.3/docker.go:326:32: p.client.DaemonHost undefined (type *client.Client has no field or method DaemonHost)
Any idea why I get this and how to fix it?

Have you tried with Go modules? I noticed glide's last commit is from 2'5 years ago, not sure if you're still using it.
With Go modules, it would be a matter of adding the dependency to your go.mod file. Something like this:
require (
github.com/testcontainers/testcontainers-go v0.12.0
)
You can find more info about installing it in project's docs: https://golang.testcontainers.org/quickstart/gotest/#1-install
Related to the current error with glide, it seems the Docker dependency in testcontainers-go v0.0.3 (docker/docker-v0.7.3) should include the client.DaemonHost method, which was added on 22 May 2017 in https://github.com/moby/moby/commit/6ce6ae1cd11d888e0c8ede20926b86981cee5ce1.
I recommend you using a newer version of the library (v0.12.0)

Related

RcppArmadillo undefined symbol: dpotrf_ in Travis build

I have looked at many other posts related to this issue and have tried each solution. None have worked in my case, including copying over the makevars from Rcpp. Anyhow, when building on Travis I get the following error
undefined symbol: dpotrf_’
The interesting note is that the package installs fine on windows, macOS, and linux.
here is my repo R package
I can reproduce the failure on a very standard Debian testing system (which I use for the extensive reverse dependency checks on Rcpp and RcppArmadillo).
After installing packages bain and BFpack (I had the rest) I attempted to build the tar.gz from your pristine just-checked-out sources. And I get:
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘BGGM’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/tmp/Rinst106c6ed5251a/00LOCK-BGGM/00new/BGGM/libs/BGGM.so':
/tmp/Rinst106c6ed5251a/00LOCK-BGGM/00new/BGGM/libs/BGGM.so: undefined symbol: dpotrf_
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/tmp/Rinst106c6ed5251a/BGGM’
-----------------------------------
ERROR: package installation failed
This appears to be a moderately complex and large enough package so please pardon me for not diving in and debugging. I would suggest you simplify with smaller mock packages to see what may be wrong. (dpotrf is a fairly standard LAPACK routine so something somewhere calls it. Maybe you call it explicitly. Maybe you did a Fortran-to-C mapping wrong. Maybe you have something wrong in how you interface with RcppArmadillo. Hard to tell...)
Edit: You committed compiled code and a Windows library. "Don't do that." When Travis builds it also starts from a git checkout as I did. That may be the difference.
Edit 2: It wasn't, but your R code mixes .Call() with generated entry points (ie via RcppExports.cpp and RcppExports.R). I have seen that blow up for other people. That may be something to look into.
Disclaimer: I work with D_Williams, but I figured out the problem, and others may find it useful.
A functioning configure.ac was present, and a Makevars.in is present.
The problem is that the configure file was not yet generated. This is an autotools/autoconf setup. To resolve it, I ran autoconf in the package directory, which generated the configure file. That configure file is then executed when R builds the package. The configure file modifies the Makevars.in and creates Makevars. That Makevars file ultimately defines where to find libraries, includes, compilers, compiler options, etc.
If you do not generate the configure file from configure.ac using autoconf, then there is no configure file to be executed, and no Makevars to define the needed options at compile time. Therefore, the compiler is not fully configured, and it will fail.
TLDR: If you have an configure.ac, you must run autoconf on it, and commit that configure file to your repo. R needs to execute it to have a functioning Makevars.

Error: Could not find or load main class io.druid.cli.Main

I am deploying Apache-druid image using docker-compose. I am getting following error,
Error: Could not find or load main class io.druid.cli.Main.
I have set CLASSPATH properly. Files are in CLASSPATH.
Any Pointers? Thanks for your help.
Thanks,
Shubhada
I fixed this issue. I was using different version of Druid. Which has differnnt package hierarchy of the class Main. Changed it to correct one.
If others run into similar issue, here's some more context. From Druid version 0.13.0 onwards, the config scripts need to use org.apache.druid.cli.Main. So if you are working on a prior version, and run into this error, change io.druid.cli.Main to org.apache.druid.cli.Main in your scripts. Better option is to upgrade cleanly to a newer version.

How to build using cra-append-sw now that #babel/polyfill has been deprecated?

I'm trying to add functionality to the serviceworker that create-react-app provides out of the box. Thankfully, cra-append-sw lets me do that without needing to eject from cra.
However, when installing cra-append-sw, npm gives me a warning that #babel/polyfill#7.4.4 has been deprecated (#babel/polyfill is listed as a cra-append-sw dependency):
As of Babel 7.4.0, this package has been deprecated in favor of directly including core-js/stable (to polyfill ECMAScript features) and regenerator-runtime/runtime (needed to use transpiled generator functions):
import "core-js/stable";
import "regenerator-runtime/runtime";
Then, when I try to npm run build to append a custom service worker, the build spits out a long error message, the top of which is:
ERROR in multi ./custom-sw.js
Module not found: Error: Can't resolve './custom-sw.js' in '/Users/michaelmersiades/workspace/vanilla-cra'
resolve './custom-sw.js' in '/Users/--/workspace/vanilla-cra'
using description file: /Users/--/workspace/vanilla-cra/package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
and custom-sw.js is not showing up in the build folder.
Is this fixable? If so, how? Or is this an issue for the good ira-append-sw folk?
My thanks in advance to anyone who can help.
Silly error. The custom-sw.js file was inside /src, but it needed to be in / (the root folder).
Moving it to / solved the problem.

Since when has the angular transformer required the dartSdk path be specified in pubspec.yaml?

I'm writing a new Angular.dart 1.0 app, and upon building, pub is giving me the following error:
Loading angular transformers...
Error on line 15, column 3 of pubspec.yaml: Error loading transformer: Invalid arguments(s): sdkDirectory must be provided.
I had an Angular.dart app written against 0.14 that didn't require this. I also went to look at the Angular.dart tutorial and there was no mention of this setting. Having to actually specify it makes CI tricky. Since when was this required, and is there a way to avoid specifying it in pubspec.yaml (environment variable, for example?)
Update
Should be fixed in code_transformers 0.2.3+2 (see http://dartbug.com/21225)
Old
See https://github.com/angular/angular.dart/issues/1270#issuecomment-64967674
If you create a symlink
ln -s /usr/lib/dart /usr/lib/dart/bin/dart-sdk
then you don't need the sdkDirectory in the transformer setting in the pubspec.yaml file.
This is very annoying. I also think that an environment variable would be the best solution, but seems this is not supported.
It's still a problem with my environnement (macos + brew + code_transformers 0.2.3+2). Fixed with
ln -s /usr/local/opt/dart/libexec /usr/local/opt/dart/libexec/bin/dart-sdk
Edit: OR by using code_transformers 0.2.5 (see https://github.com/Netflix/security_monkey/issues/100)
I actually had to force it in pubspec.yaml :
dependency_overrides:
code_transformers: 0.2.5

ZEND2 project not working after cloned to separate machine

I have cloned my office colleague's zend2 project from our server. He used zfcuser, zfcbase, and zfcadmin. But when I tried to run the project in my local machine its giving
<b>Fatal error</b>: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException'
with message 'Module (ZfcBase) could not be initialized.' in C:\xampp\htdocs\coolshop
\vendor\ZF2\library\Zend\ModuleManager\ModuleManager.php:140
Everything is fine to me as the same project 100% working in my colleague's machine. I tried the composer as well. But no luck
This is a result of loading the ZfcBase module as a git submodule. If you fix this module you'll receive the same error for other modules or dependencies you're using in that manner. I've encountered this problem when someone tries to clone the project on a new machine or you delete the project locally and try to re-clone it.
The simple answer here is to use composer as your dependency manager, you'll have a better day. Head over to ZfcBase on Packagist and copy the require statement into your composer.json file (You'll need to run the composer script after saving your .json file). Most modules should have instructions on using composer to grab them in the README.
I should note that if you're using other modules that depend on ZfcBase, you'll likely just need to have a require statement for those, and not their dependencies (like ZfcBase).
Someone had a similar question regarding the ZfcUser module. Using composer solved his issue.

Resources