Command "rabbitmq-plugins enable rabbitmq_management" fails with "Error: noproc" - rabbitmq

My team has a continuous integration script running in Bitbucket Pipelines that includes some RabbitMQ tests.
Our bitbucket-pipelines.yml file looks like this:
image: python:3.6.8
pipelines:
default:
- step:
name: Run Tests
caches:
- pip
script:
- pip install -r requirements.txt
- apt-get update
- apt-get install -y rabbitmq-server
- rabbitmq-server -detached
- sleep 2
- rabbitmq-plugins enable rabbitmq_management
- sleep 2
- rabbitmqctl stop
- sleep 2
- rabbitmq-server -detached
- python tests.py
Around 50% of the time we get the following error:
+ rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit#90a65858-035c-4b74-be6b-a0e43bb508d1... failed.
Error: noproc
Re-running the pipeline generally "fixes" the problem. But this is eating away at our build minutes, and is quite frustrating to constantly re-run failed pipelines.
We added some sleep commands in there to try and slow things down, but thats obviously not working as intended, because we keep getting the "Error: noproc"
I'm hopeful that we are just "holding it wrong" but after lots of research and experimentation, it's not clear to me what were doing wrong.

Related

avast / gradle-docker-compose-plugin not working

I'm using the avast /
gradle-docker-compose-plugin - https://github.com/avast/gradle-docker-compose-plugin in my project here - https://github.com/johnnyalpha8/Pet-Shop/blob/main/build.gradle.kts .
My project is a SpringBoot Kotlin API.
I believe I have configured the plugin correctly. I have added it to the plugins block of my build.gradle.kts -
plugins {
...
id("com.avast.gradle.docker-compose") version "0.15.2"
}
Now when I try out the new task ./gradlew composeUp the container starts up just fine, but then immediately shuts down and the build fails with -
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ config --services
Successfully started process 'command 'docker-compose''
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ ps --services
Successfully started process 'command 'docker-compose''
List containers.
Usage: ps [options] [SERVICE...]
Options:
-q Only display IDs
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ config --services
Successfully started process 'command 'docker-compose''
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ stop --timeout 10 myservice mariadb
Successfully started process 'command 'docker-compose''
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ...
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ...
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ... done
Stopping 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ... done
Starting process 'command 'docker-compose''. Working directory: /home/charliejade/dev/apps/reactiveKotlin-source-code Command: docker-compose --no-ansi -p 649e9eedea35a6b45cffd19a30f272cd_reactiveKotlin_ down --volumes
Successfully started process 'command 'docker-compose''
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ...
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ...
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_myservice_1 ... done
Removing 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_1 ... done
Removing volume 649e9eedea35a6b45cffd19a30f272cdreactivekotlin_mariadb_data
> Task :composeUp FAILED
:composeUp (Thread[Execution worker for ':',5,main]) completed. Took 1 mins 18.015 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':composeUp'.
> Exit-code 1 when calling docker-compose, stdout:
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 19s
Gradle Scan - https://scans.gradle.com/s/ealbm2cysvi42
Full debug logs with stacktrace can be found here - https://github.com/johnnyalpha8/Pet-Shop/issues/1
I am using -
Linux Mint 19.3 Tricia as my OS.
Kotlin v1.6.20
docker-compose version 1.17.1
I should add that my services start correctly when done manually with docker-compose up docker-compose.yml. My docker-compose.yml file has two services, mariadb + my Kotlin REST API. I've tried ./gradlew composeUp with just mariadb in the docker-compose file and I get the same result.
Feel free to checkout the code from here - https://github.com/johnnyalpha8/Pet-Shop and try it out for yourself :(
I am quite stumped, but don't want to give up on the plugin just yet :)!
Any insight into what is wrong would be appreciated!

GitLab CI image: alpine "apk: command not found" error

I'm trying to follow this tutorial to enable formatting checks using black in GitLab CI.
To make things simpler, I've transferred the code from .lint-ci.yml over to .gitlab-ci.yml. The tag of the shared runner that I'm using is gitlab-ci. I'm getting the following error when the pipeline gets run:
bash: line 80: apk: command not found
ERROR: Job failed: exit status 1
Obviously, that's getting thrown for the apk --no-cache add py3-pip python3-dev gcc linux-headers musl-dev libffi-dev openssl-dev git line.
Here's the .gitlab-ci.yml file:
formatter:
stage: build
tags:
- gitlab-ci
image: alpine
only:
- branches
before_script:
- apk --no-cache add py3-pip python3-dev gcc linux-headers musl-dev libffi-dev openssl-dev git
- pip install black
script:
- black . --check
allow_failure: false
Can someone help me solve this issue?
As requested by #slauth, here's the full output of the job:
Running with gitlab-runner 11.6.1 (id1)
on gitlab-ci -CzBAN4M
Using Shell executor...
Running on gitserver...
Fetching changes...
HEAD is now at id2 a
From http://gitserver....
Checking out id3 as gitlabci...
Skipping Git submodules setup
$ apk --no-cache add py3-pip python3-dev gcc linux-headers musl-dev libffi-dev openssl-dev git
bash: line 80: apk: command not found
ERROR: Job failed: exit status 1
Your runner is using the "Shell" executor which does not support the image: configuration, see this compatibility chart.

How do I start a RabbitMQ node?

I keep getting this error every time I try to do something with RabbitMQ:
attempted to contact: [fdbvhost#FORTE]
fdbvhost#FORTE:
* connected to epmd (port 4369) on FORTE
* epmd reports: node 'fdbvhost' not running at all
no other nodes on FORTE
* suggestion: start the node
current node details:
- node name: 'rabbitmq-cli-54#FORTE'
- home dir: C:\Users\Jesus
- cookie hash: iuRlQy0F81aBpoY9aQqAzw==
This is the output I get when I run rabbitmqctl -n fdbvhost status or /rabbitmqctl -n fdbvhost list_vhosts.
I've tried rabbitmqctl -n fdbvhost start which gives me the following output:
Error: could not recognise command
Usage:
rabbitmqctl [-n <node>] [-t <timeout>] [-q] <command> [<command options>]
...
So this doesn't start it. I cannot find anything about starting a node in the documentation. How do I actually start my node/vhost?
Try running the following command from the RabbitMQ's installation sbin directory
rabbitmq-server start -detached
This should start the broker node if it was stopped for some reason.
Check if you have RabbitMQ installed as a service in the /etc/init.d/ folder
sudo su # might be needed
cd /etc/init.d/
ls . | grep rabbit
The output should be rabbitmq-server
If that's the case, then, try restarting your service with:
sudo service rabbitmq-server restart
For mac users
To Start
brew services start rabbitmq
To Restart
brew services restart rabbitmq
To Stop
brew services stop rabbitmq
To Know the status of the server
brew services info rabbitmq

My gitlab-ci-multi-runner doesn't recognize npm command

I'm using https://github.com/sameersbn/docker-gitlab-ci-multi-runner and spin this one up with docker compose.
The weird thing is that my jobs get stuck on npm command not recognized.
But my base image is node:latest, so it should work.
This is my .gitlab-ci.yml file:
image: node:latest
cache:
paths:
- node_modules/
before_script:
- npm install
- bower install --allow-root
stages:
- build_deploy
build_&_deploy_app:
stage: build_deploy
only:
- master
script:
- gulp build -production
- gulp deploy
variables:
GIT_SSL_NO_VERIFY: "1"
Note: I needed to turn of SSL verification, because that is another issue to fix.
The output of the job is:
gitlab-ci-multi-runner 1.1.4 (9e2fd1a)
WARNING: image is not supported by selected executor and shell
Using Shell executor...
Running on 6687502ce71f...
Fetching changes...
HEAD is now at 42e9d51 Update .gitlab-ci.yml
Checking out 42e9d511 as master...
HEAD is now at 42e9d51... Update .gitlab-ci.yml
Checking cache for default...
$ npm prune
bash: line 56: npm: command not found
ERROR: Build failed: exit status 1
I had the same problem, and registering my runner as docker executor helped:
first I unregistered all my runners with sudo gitlab-runner unregister --all-runners and then I registered a runner with docker executor:
sudo gitlab-runner register \
--non-interactive \
--url "https://gitlab.com/" \
--registration-token "<Your registration token>" \
--executor "docker" \
--docker-image alpine:latest \
--description "docker-runner" \
--tag-list "docker,aws" \
--run-untagged="true" \
--locked="false" \
--access-level="not_protected"

Gitlab CI, ssh runner

When I try to create ssh runner in deploy console I have this error:
Running with gitlab-ci-multi-runner 1.7.1 (f896af7)
Using SSH executor...
ERROR: Preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory
Will be retried in 3s ...
Using SSH executor...
ERROR: Preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory
Will be retried in 3s ...
Using SSH executor...
ERROR: Preparation failed: open ~/.ssh/id_rsa.pub: no such file or directory
Will be retried in 3s ...
ERROR: Build failed (system failure): open ~/.ssh/id_rsa.pub: no such file or directory
On my server I created ssh key, and this key is in directory ~/.ssh/id_rsa.pub.
My .gitlab-ci.yml file:
stages:
- deploy
before_script:
- whoami
mate-finder:
stage: deploy
script:
- sudo apt-get update -qy
- sudo apt-get install -y nodejs
- sudo npm install
- sudo ng build
- sudo ng serve
How can I deploy my application on server? How must I configure my runner on the server, when I want to deploy my angular2 application on it?
You need to check, where config.toml is placed. You can do it with a search.
find / -name 'config.toml'
If result would be
/etc/gitlab-runner/config.toml
You running runner as root. And you need to specify full path like /root/.ssh/id_rsa.
If no - you running it under other user and you'll need to specify directory like /home/user/.ssh/id_rsa.
To find out which user you are - register shell executor and run pwd or whoami
I believe it would be gitlab-runner if not root.
In my case, I change ~/.ssh/id_rsa path to /root/id_rsa.
when I changed in config.toml it is not helped, but reconfigure the runner fix that.