Mongo connector [Mongodb - Elastic Search] Docker Crashes - mongodb

docker-compose.yml, also i have enabled rs.initiate(config) for replica set. What am I doing wrong here? How to connect replica set. And how to know primary of replica set to initiate mongo-connector. I see Member techiez_db_container_1:27017 is now in state PRIMARY log after the crash. How to synchronise or wait for mongo_one container to become primary.
version: '3.3'
services:
mongo_one:
container_name: techiez_db_container_1
image: mongo
command: mongod --replSet techiez-set
ports: ['27017:27017']
networks: ['techiez']
mongo_two:
container_name: techiez_db_container_2
image: mongo
command: mongod --replSet techiez-set
ports: ['27018:27017']
networks: ['techiez']
mongo_three:
container_name: techiez_db_container_3
image: mongo
command: mongod --replSet techiez-set
ports: ['27019:27017']
networks: ['techiez']
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.16
container_name: elasticsearch
ports: ['9200:9200']
networks: [techiez]
mongoconnector:
image: yeasy/mongo-connector
links: ['elasticsearch:elasticsearch', 'mongo_one:mongo']
depends_on: ['mongo_one', 'mongo_two', 'mongo_three', 'elasticsearch']
networks: [techiez]
networks:
techiez: {}
Below is the Crash Log
mongoconnector_1 | Logging to mongo-connector.log.
mongoconnector_1 | Exception in thread Thread-1:
mongoconnector_1 | Traceback (most recent call last):
mongoconnector_1 | File "/usr/local/lib/python3.4/site-packages/pymongo/mongo_client.py", line 425, in __init__
mongoconnector_1 | self._ensure_connected(True)
mongoconnector_1 | File "/usr/local/lib/python3.4/site-packages/pymongo/mongo_client.py", line 1083, in _ensure_connected
mongoconnector_1 | self.__ensure_member()
mongoconnector_1 | File "/usr/local/lib/python3.4/site-packages/pymongo/mongo_client.py", line 957, in __ensure_member
mongoconnector_1 | member, nodes = self.__find_node()
mongoconnector_1 | File "/usr/local/lib/python3.4/site-packages/pymongo/mongo_client.py", line 1048, in __find_node
mongoconnector_1 | raise AutoReconnect(', '.join(errors))
mongoconnector_1 | pymongo.errors.AutoReconnect: mongo:27017 is not primary or master
mongoconnector_1 |
mongoconnector_1 | During handling of the above exception, another exception occurred:
mongoconnector_1 |
mongoconnector_1 | Traceback (most recent call last):
mongoconnector_1 | File "/usr/local/lib/python3.4/threading.py", line 920, in _bootstrap_inner
mongoconnector_1 | self.run()
mongoconnector_1 | File "/usr/local/lib/python3.4/site-packages/mongo_connector/util.py", line 85, in wrapped
mongoconnector_1 | func(*args, **kwargs)
mongoconnector_1 | File "/usr/local/lib/python3.4/site-packages/mongo_connector/connector.py", line 285, in run
mongoconnector_1 | tz_aware=self.tz_aware, **self.ssl_kwargs)
mongoconnector_1 | File "/usr/local/lib/python3.4/site-packages/pymongo/mongo_client.py", line 428, in __init__
mongoconnector_1 | raise ConnectionFailure(str(e))
mongoconnector_1 | pymongo.errors.ConnectionFailure: mongo:27017 is not primary or master
mongoconnector_1 |
techiez_mongoconnector_1 exited with code 0

Related

Docker: Error response from daemon: driver failed programming external connectivity

So I am trying to run searxng in a docker container, but it just loads a blank page. Running docker-compose logs -f searxng spits out the following:
searxng | Traceback (most recent call last):
searxng | File "/usr/local/searxng/searx/search/processors/abstract.py", line 75, in initialize
searxng | self.engine.init(get_engine_from_settings(self.engine_name))
searxng | File "/usr/local/searxng/searx/engines/zlibrary.py", line 39, in init
searxng | resp = http_get('https://z-lib.org', timeout=5.0)
searxng | File "/usr/local/searxng/searx/network/__init__.py", line 165, in get
searxng | return request('get', url, **kwargs)
searxng | File "/usr/local/searxng/searx/network/__init__.py", line 96, in request
searxng | return future.result(timeout)
searxng | File "/usr/lib/python3.10/concurrent/futures/_base.py", line 446, in result
searxng | return self.__get_result()
searxng | File "/usr/lib/python3.10/concurrent/futures/_base.py", line 391, in __get_result
searxng | raise self._exception
searxng | File "/usr/local/searxng/searx/network/network.py", line 291, in request
searxng | return await self.call_client(False, method, url, **kwargs)
searxng | File "/usr/local/searxng/searx/network/network.py", line 287, in call_client
searxng | raise e
searxng | File "/usr/local/searxng/searx/network/network.py", line 272, in call_client
searxng | response = await client.request(method, url, **kwargs)
searxng | File "/usr/lib/python3.10/site-packages/httpx/_client.py", line 1513, in request
searxng | return await self.send(request, auth=auth, follow_redirects=follow_redirects)
searxng | File "/usr/lib/python3.10/site-packages/httpx/_client.py", line 1600, in send
searxng | response = await self._send_handling_auth(
searxng | File "/usr/lib/python3.10/site-packages/httpx/_client.py", line 1628, in _send_handling_auth
searxng | response = await self._send_handling_redirects(
searxng | File "/usr/lib/python3.10/site-packages/httpx/_client.py", line 1665, in _send_handling_redirects
searxng | response = await self._send_single_request(request)
searxng | File "/usr/lib/python3.10/site-packages/httpx/_client.py", line 1702, in _send_single_request
searxng | response = await transport.handle_async_request(request)
searxng | File "/usr/lib/python3.10/site-packages/httpx/_transports/default.py", line 307, in handle_async_request
searxng | with map_httpcore_exceptions():
searxng | File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
searxng | self.gen.throw(typ, value, traceback)
searxng | File "/usr/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
searxng | raise mapped_exc(message) from exc
searxng | httpx.ConnectTimeout
I'm running this on arch linux, maybe that could have something to do with it. Here is also my neofetch output:
- OS: Arch Linux x86_64
- Host: 81YM IdeaPad 5 14ARE05
- Kernel: 5.15.82-1-lts
- Packages: 1426 (pacman), 32 (flatpak)
- Shell: bash 5.1.16
- DE: GNOME 43.2
- CPU: AMD Ryzen 5 4600U with Radeon Graphics (12) # 2.100GHz
- GPU: AMD ATI 04:00.0 Renoir
- Memory: 8790MiB / 15364MiB
I followed all the steps for the installation, as well as following the 'How to use it' Link with no errors.
Running the command docker-compose up -d starts the containers without error, but trying to access localhost or 127.0.0.1 or 127.0.0.1:8080:8080 (as it states in the docker-compose.yaml file)

Exclude kubernetes namespaces from metric collection by datadog agent

After installing datadog chart (version=3.1.3) on EKS, I need to limit some of namespaces from metric collection. I'm using containerExclude to limit the namespace scope. The values I'm using is as follows:
datadog:
site: datadoghq.eu
clusterName: eks-test
kubeStateMetricsEnabled: false
kubeStateMetricsCore:
enabled: false
containerExclude: "kube_namespace:astronomer kube_namespace:astronomer-.* kube_namespace:kube-system kube_namespace:kube-public kube_namespace:kube-node-lease"
prometheusScrape:
enabled: true
serviceEndpoints: true
additionalConfigs:
- autodiscovery:
kubernetes_annotations:
include:
prometheus.io/scrape: "true"
exclude:
prometheus.io/scrape: "false"
clusterAgent:
enabled: true
metricsProvider:
enabled: false
agents:
enabled: true
Looking at the pod environment variables, I see this is being passed to agent correctly:
DD_CONTAINER_EXCLUDE: kube_namespace:astronomer kube_namespace:astronomer-.* kube_namespace:kube-system kube_namespace:kube-public kube_namespace:kube-node-lease
However I see see scrape logs from those namespaces:
2022-09-26 13:48:38 UTC | CORE | INFO | (pkg/collector/python/datadog_agent.go:127 in LogMessage) | openmetrics:f744b75c375b067b | (base.py:60) | Scraping OpenMetrics endpoint: http://172.20.79.111:9102/metrics
2022-09-26 13:48:38 UTC | CORE | INFO | (pkg/collector/python/datadog_agent.go:127 in LogMessage) | openmetrics:c52e8d14335bb33d | (base.py:60) | Scraping OpenMetrics endpoint: http://172.20.22.119:9102/metrics
2022-09-26 13:48:39 UTC | CORE | ERROR | (pkg/collector/python/datadog_agent.go:123 in LogMessage) | openmetrics:ba505488f569ffa0 | (base.py:66) | There was an error scraping endpoint http://172.20.0.10:9153/metrics: HTTPConnectionPool(host='172.20.0.10', port=9153): Max retries exceeded with url: /metrics (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fd271df8190>, 'Connection to 172.20.0.10 timed out. (connect timeout=10.0)'))
2022-09-26 13:48:39 UTC | CORE | ERROR | (pkg/collector/worker/check_logger.go:69 in Error) | check:openmetrics | Error running check: [{"message": "There was an error scraping endpoint http://172.20.0.10:9153/metrics: HTTPConnectionPool(host='172.20.0.10', port=9153): Max retries exceeded with url: /metrics (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fd271df8190>, 'Connection to 172.20.0.10 timed out. (connect timeout=10.0)'))", "traceback": "Traceback (most recent call last):\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/base.py\", line 1116, in run\n self.check(instance)\n File \"/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/openmetrics/v2/base.py\", line 67, in check\n raise_from(type(e)(\"There was an error scraping endpoint {}: {}\".format(endpoint, e)), None)\n File \"<string>\", line 3, in raise_from\nrequests.exceptions.ConnectTimeout: There was an error scraping endpoint http://172.20.0.10:9153/metrics: HTTPConnectionPool(host='172.20.0.10', port=9153): Max retries exceeded with url: /metrics (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7fd271df8190>, 'Connection to 172.20.0.10 timed out. (connect timeout=10.0)'))\n"}]
2022-09-26 13:48:39 UTC | CORE | INFO | (pkg/collector/python/datadog_agent.go:127 in LogMessage) | openmetrics:8e74b74102a3722 | (base.py:60) | Scraping OpenMetrics endpoint: http://172.20.129.200:9102/metrics
2022-09-26 13:48:39 UTC | CORE | INFO | (pkg/collector/python/datadog_agent.go:127 in LogMessage) | openmetrics:e6012834c5d9bc2e | (base.py:60) | Scraping OpenMetrics endpoint: http://172.20.19.241:9127/metrics
2022-09-26 13:48:39 UTC | CORE | INFO | (pkg/collector/python/datadog_agent.go:127 in LogMessage) | openmetrics:ba98e825c73ee1b4 | (base.py:60) | Scraping OpenMetrics endpoint: http://172.20.64.136:9102/metrics
Those services belong to kube-system which is excluded. But I see that these metrics belong to Prometheus [Openmetrics]. Do I have to apply similar setting in prometheusScrape.additionalConfigs?

Yocto glibc_2.30.bb fatal error: asm/unistd.h: No such file or directory

I am trying to build Yocto Zeus in Podman and getting the below error. I noticed that sigcontext.h header file .recipe-sysroot/usr/include/ only has 32bit version whereas unistd.h file copied under asm-generic directory.
./recipe-sysroot/usr/include/asm/sigcontext-32.h
./recipe-sysroot/usr/include/asm-generic/unistd.h
| ../sysdeps/unix/sysv/linux/sys/syscall.h:24:10: fatal error: asm/unistd.h: No such file or directory
| 24 | #include <asm/unistd.h>
| | ^~~~~~~~~~~~~~
| compilation terminated.
| Traceback (most recent call last):
| File "../scripts/gen-as-const.py", line 120, in <module>
| main()
| File "../scripts/gen-as-const.py", line 116, in main
| consts = glibcextract.compute_c_consts(sym_data, args.cc)
| File "/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/git/scripts/glibcextract.py", line 62, in compute_c_consts
| subprocess.check_call(cmd, shell=True)
| File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
| raise CalledProcessError(retcode, cmd)
| subprocess.CalledProcessError: Command 'arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/recipe-sysroot -std=gnu11 -fgnu89-inline -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0=/usr/src/debug/glibc/2.30-r0 -fdebug-prefix-map=/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0=/usr/src/debug/glibc/2.30-r0 -fdebug-prefix-map=/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/recipe-sysroot= -fdebug-prefix-map=/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/recipe-sysroot-native= -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno -ftls-model=initial-exec -I../include -I/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/build-arm-poky-linux-gnueabi/csu -I/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/build-arm-poky-linux-gnueabi -I../sysdeps/unix/sysv/linux/arm -I../sysdeps/arm/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/arm -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/arm/armv7/multiarch -I../sysdeps/arm/armv7 -I../sysdeps/arm/armv6t2 -I../sysdeps/arm/armv6 -I../sysdeps/arm/include -I../sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -nostdinc -isystem /home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.2.0/include -isystem /home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/9.2.0/include-fixed -isystem /home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/recipe-sysroot/usr/include -D_LIBC_REENTRANT -include /home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/build-arm-poky-linux-gnueabi/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DTOP_NAMESPACE=glibc -DGEN_AS_CONST_HEADERS -MD -MP -MF /home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/build-arm-poky-linux-gnueabi/tcb-offsets.h.dT -MT '/home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/build-arm-poky-linux-gnueabi/tcb-offsets.h.d /home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/build-arm-poky-linux-gnueabi/tcb-offsets.h' -S -o /tmp/tmp2wx6srl6/test.s -x c - < /tmp/tmp2wx6srl6/test.c' returned non-zero exit status 1
| make[2]: *** [../Makerules:271: /home/dev/inode_zeus/build/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/glibc/2.30-r0/build-arm-poky-linux-gnueabi/tcb-offsets.h] Error 1
| make[2]: *** Waiting for unfinished jobs....
| In file included from ../signal/signal.h:291,
| from ../include/signal.h:2,
| from ../misc/sys/param.h:28,
| from ../include/sys/param.h:1,
| from ../sysdeps/generic/hp-timing-common.h:39,
| from ../sysdeps/generic/hp-timing.h:25,
| from ../nptl/descr.h:27,
| from ../sysdeps/arm/nptl/tls.h:42,
| from ../sysdeps/unix/sysv/linux/arm/tls.h:23,
| from ../include/link.h:51,
| from ../include/dlfcn.h:4,
| from ../sysdeps/generic/ldsodefs.h:32,
| from ../sysdeps/arm/ldsodefs.h:38,
| from ../sysdeps/gnu/ldsodefs.h:46,
| from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
| from ../sysdeps/unix/sysv/linux/arm/ldsodefs.h:22,
| from <stdin>:2:
| ../sysdeps/unix/sysv/linux/bits/sigcontext.h:30:11: fatal error: asm/sigcontext.h: No such file or directory
| 30 | # include <asm/sigcontext.h>
| | ^~~~~~~~~~~~~~~~~~
| compilation terminated.
|
ERROR: Task (/home/dev/inode_zeus/sources/poky/meta/recipes-core/glibc/glibc_2.30.bb:do_compile) failed with exit code '1'
DEBUG: Teardown for bitbake-worker
NOTE: Tasks Summary: Attempted 437 tasks of which 430 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/dev/inode_zeus/sources/poky/meta/recipes-core/glibc/glibc_2.30.bb:do_compile
Please note that I am able to build Jethro version using the Podman Container which runs Ubuntu16.04.
But, Zeus build is failing. Can someone tell me why these errors are seen?
I am able to resolve the issue by mapping the yocto build directory with host directory.
Yocto build worked liked a charm!
podman --storage-opt overlay.mount_program=/usr/bin/fuse-overlayfs --storage-opt overlay.mountopt=nodev,metacopy=on,noxattrs=1 run -it -v $PWD/my_yocto/build_output:/home/oibdev/yocto/build 4cbcb3842ed5

Accessing unique closure on List of objects gives UnsupportedOperationException

I am working on Grails 2.3.11 and am using MongoDb plugin mongodb:3.0.3.
My code looks like this:
def home() {
List abcs = ABC.list()
println abcs.unique { it.parent }
}
The code breaks while accessing unique closure.
The exception says:
ERROR errors.GrailsExceptionResolver- UnsupportedOperationException occurred when processing request: [GET] /MongoAppInEcomEnv/product/home
Stacktrace follows:
Message: null
Line | Method
->> 148 | add in java.util.AbstractList
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 108 | add in ''
| 342 | addAll . in java.util.AbstractCollection
| 120 | $tt__home in com.test.aitm.ProductController$$EPCH6LtA
| 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run . . . in java.lang.Thread
Looks like the list is empty.
Also you could try
abcs.parent.unique()

plugin ":mail:1.0.7" has syntax error on execution

mail {
host = "smtp.1und1.de"
port = 465
username = "pt8100853-1"
password = "xxxxxxxx"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
is the contents of config groovy. My controller contains
sendMail {
to "gaby#strotmann.org"
subject "Hello Fred"
body 'How are you?'
}
After activating sendMail I get:
Error 2015-02-25 21:19:25,883 [http-bio-8080-exec-8] ERROR errors.GrailsExceptionResolver - MailSendException occurred when processing request: [GET] /Partner/kommunikation/eMail
Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 501 Syntax error in parameters or arguments
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 501 Syntax error in parameters or arguments
. Stacktrace follows:
Message: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 501 Syntax error in parameters or arguments
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 501 Syntax error in parameters or arguments
Line | Method
->> 131 | sendMessage in grails.plugin.mail.MailMessageBuilder
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 55 | sendMail in grails.plugin.mail.MailService
| 59 | sendMail . in ''
| 165 | doCall in MailGrailsPlugin$_configureSendMail_closure6
| 37 | eMail . . . in org.strotmann.partner.KommunikationController
| 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter . in grails.plugin.cache.web.filter.AbstractFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
I'm somewhat confused to get a syntax error, as I copied the original code directly from the plugin documentation.
How can I escape that problem?