Cypress - The plugins file is missing or invalid running on Docker - docker

I add this import - const { addMatchImageSnapshotPlugin } = require("cypress-image-snapshot/plugin");
into file cypress/plugins/index.js.
And error is thrown while running on Docker:
Your `pluginsFile` is set to `/cypress/plugins/index.js`, but either the file is missing, it contains a syntax error, or threw an error when required. The `pluginsFile` must be a `.js`, `.ts`, or `.coffee` file.
It works perfectly when I'm running the specs locally but strangely it fail when they are runned on the docker image.
`

Related

Minikube "icacls failed applying permissions "

suddently, this error message started appearing when starting minikube:
* Creating docker container (CPUs=2, Memory=4000MB) .../ E0124 18:28:01.039963 8724 kic.go:267] icacls failed applying permissions - err - [%!s(<nil>)], output - [file elaborato: C:\Users\user\.minikube\machines\minikube\id_rsa
Elaborazione completata per 1 file. Elaborazione non riuscita per 0 file]
It's strange because it gives an error, but also sais that 1 file has been elaborated correctly.
Minikube is not behaving strange though. Should I just ignore this?
Sounds like it is a known issue (and will be fixed in 1.26.0): https://github.com/kubernetes/minikube/issues/13868

Error when running near indexer localnet, fail to generate config.json

So I'm trying to run the indexer on localnet following the official tutorial https://docs.near.org/docs/tutorials/near-indexer
However when I run cargo run -- init to generate the localnet json config I get this error
Finished dev [unoptimized + debuginfo] target(s) in 17.62s
Running `target/debug/example-indexer init`
thread 'main' panicked at 'Failed to deserialize config: Error("expected value", line: 1, column: 1)', /home/francois/.cargo/git/checkouts/nearcore-5bf7818cf2261fd0/a44be20/nearcore/src/config.rs:499:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
At some point it seems the json is not created or not created properly I guess, the function crashing in config.rf line 499 is
impl From<&str> for Config {
fn from(content: &str) -> Self {
serde_json::from_str(content).expect("Failed to deserialize config")
}
}
It's quite difficult to debug since cargo run -- init is using some inner near function (also I'm new to rust).
the config.json file is created but it seems the permission are not set properly by the script, the content of config.json is
"<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message> ... "
If anyone from the community has encountered this problem or has a hint it would be great!! thanks a lot !
In the tutorial you referenced, it mentions a similar error, and suggests the following:
Open your config.json located in the .near folder in the root of your home directory. ( ~/.near/config.json )
In this file, locate: "tracked_shards": [] and change the value to [0].
Save the file and try running your indexer again.
So I had the wrong config with download_config: false,
It should be download_config: false, for the localnet use

How can I use ImageMagick to read SVG files in Elastic Beanstalk?

I'm trying to use ImageMagick to read SVG files. This works just fine locally, since I have librsvg (https://github.com/GNOME/librsvg) installed on my machine. However, the package doesn't seem to be available through yum, which is what Elastic Beanstalk uses.
So in my backend (Rails/Postgresql) I have something like:
def save_svg_as_image
file = params[:uploaded_svg]
#svg_image = MiniMagick::Image.read(file)
self.svg = #svg_image
end
Again, this works fine on local thanks to librsvg, but when testing with my EB (64bit Amazon Linux/2.11.4), I get:
MiniMagick::Invalid (`identify /tmp/mini_magick20210205-24760-bygqeh` failed with error:
identify: no decode delegate for this image format `/tmp/mini_magick20210205-24760-bygqeh' # error/constitute.c/ReadImage/544.
):
I've attempted using the following solution: Taking the code from https://gist.github.com/whyvez/1e0212a35da97aa8f1b1 and using it in a packages.config file, but I'm continually getting the following error:
Command failed on instance. Return code: 2 Output: wget: unrecognized option '--prefix=/usr'

Hadoop/Yarn Docker-Container-Executor fails because of "Invalid docker rw mount"

I am trying to execute the simple example for the Hadoop/Yarn (Version: 2.9.1) Docker-Container-Executor:
vars="YARN_CONTAINER_RUNTIME_TYPE=docker,YARN_CONTAINER_RUNTIME_DOCKER_IMAGE=hadoop-docker"
hadoop jar hadoop-examples.jar pi -Dyarn.app.mapreduce.am.env=$vars -Dmapreduce.map.env=$vars -Dmapreduce.reduce.env=$vars 10 100
Unfortunately the job fails with the following exception:
Failing this attempt.Diagnostics: [2018-09-08 22:23:54.288]Exception from container-launch.
Container id: container_1536441225683_0004_02_000001
Exit code: 29
Exception message: Invalid docker rw mount '/tmp/hadoop-hadoop/nm-local-dir/usercache/hadoop/appcache/application_1536441225683_0004/:/tmp/hadoop-hadoop/nm-local-dir/usercache/hadoop/appcache/application_1536441225683_0004/', realpath=/tmp/hadoop-hadoop/nm-local-dir/usercache/hadoop/appcache/application_1536441225683_0004/
Error constructing docker command, docker error code=14, error message='Invalid docker read-write mount'
Anybody has an idea how to solve the Invalid docker read-write mount?
Solved by adding this directory to property docker.allowed.rw-mounts in etc/hadoop/container-executor.cfg. If you get error message for multiple directories they need to be added comma seperated.
In my case:
docker.allowed.rw-mounts=/usr/local/hadoop/,/var/hadoop/yarn/local-dir,/var/hadoop/yarn/log-dir,/tmp/hadoop-hadoop/

Knife bootstrap failing through Jenkins execute shell

I'm trying to perform a "knife bootstrap" command through Jenkins web UI execute shell, but I keep getting this error message :
(this is the knife bootstrap command I'm using) :
"knife bootstrap [the node's IP] --ssh-user ec2-user --sudo --identity-file "[my key to the node]" --node-name My123 --run-list 'role[role1]' "
and this is the error message:
" ERROR: Errno::ENOENT: No such file or directory # rb_sysopen - /etc/chef/validation.pem "
when I run the 'knife bootstrap' command directly through the CLI it works fine.
any idea why it's not working from Jenkins execute shell?
It is due to validation.pem file is missing, this is default path for validation file. Either you can set path in /chef-repo/.chef/knife.rb file or you can use default location /etc/chef/validation.pem.
You can regenerate validation key from webUI and replace the existing one, this should resolve your issue.

Resources