API Connect docker gateway on localhost throwing ECONNREFUSED - loopback

I'm running the below node/npm/apic versions.
$node -v
v6.14.4
$npm -v
6.4.1
$apic -v
API Connect: v5.0.8.5-iFix (apiconnect: v3.0.25)
apiconnect-init-datapower-gateway#1.0.3
Problem: I am able to start the API on port 4001 and the datapower gw on port 4002. But getting the below error on the console. When I hit https://127.0.0.1:4002, I get a 404 not found. Any help would be appreciated? Thanks!
$apic services
Service test-api running on port 4001. Access the application dashboard at http://127.0.0.1:4001/appmetrics-dash
Service test-api-gw running on port 4002.
$apic edit
Express server listening on http://127.0.0.1:4001
loopback deprecated loopback#context middleware is deprecated. See https://docs.strongloop.com/display/APIC/Using%20current%20context for more details. ../../../../../../../.nvm/versions/node/v6.14.4/lib/node_modules/apiconnect/node_modules/loopback/server/middleware/rest.js:60:32
Building datapower-mgmt-server-lite
Step 1/13 : FROM node:6-alpine
---> dfc29bfa7d41
Step 2/13 : RUN apk add --no-cache openssl
---> Using cache
---> a985e7c62de2
Step 3/13 : WORKDIR /usr/src/app
---> Using cache
---> de637a1c8cb9
Step 4/13 : COPY ./package.json ./
---> Using cache
---> 6783f3e99010
Step 5/13 : COPY ./apim-lite lib/
---> Using cache
---> cbedb90bcefc
Step 6/13 : COPY ./common common/
---> Using cache
---> 97c2c5b69e75
Step 7/13 : ARG IBM_APICONNECT_NPM_REGISTRY
---> Using cache
---> 200299d96559
Step 8/13 : ENV npm_config_registry ${IBM_APICONNECT_NPM_REGISTRY:-https://registry.npmjs.com}
---> Using cache
---> 4df68f6d1eba
Step 9/13 : RUN npm install --prod --quiet --depth 0
---> Using cache
---> c64e5f33e3b8
Step 10/13 : ENV NODE_ENV production
---> Using cache
---> 8dc4cde17120
Step 11/13 : RUN mkdir -p /tmp/generated && chown node:node /tmp/generated
---> Using cache
---> 43d2b4ea51ff
Step 12/13 : USER node
---> Using cache
---> 1eeb74a34016
Step 13/13 : CMD [ "node", "lib/server.js" ]
---> Using cache
---> 54b6327414db
Successfully built 54b6327414db
Successfully tagged ibm-apiconnect-toolkit/datapower-mgmt-server-lite:1.1.10
Building datapower-api-gateway
Step 1/7 : FROM ibmcom/datapower:7.6.0.0.289959
---> ba469cb4cbd3
Step 2/7 : ENV DATAPOWER_ACCEPT_LICENSE=true DATAPOWER_INTERACTIVE=true
---> Using cache
---> 57802d96884a
Step 3/7 : COPY config /drouter/config
---> Using cache
---> 343a6a7c27ad
Step 4/7 : COPY local /drouter/local
---> Using cache
---> 73fdb13773ec
Step 5/7 : USER root
---> Using cache
---> e0aa0bae38d6
Step 6/7 : RUN set-user drouter
---> Using cache
---> 784be61a92cc
Step 7/7 : USER drouter
---> Using cache
---> c872a6ed1d13
Successfully built c872a6ed1d13
Successfully tagged ibm-apiconnect-toolkit/datapower-api-gateway:1.1.10
{ Error: connect ECONNREFUSED 127.0.0.1:64802
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1099:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 64802 }
Noticing these errors in the docker container logs:
20200128T044825.955Z [apiconnect][0x00330019][mgmt][error] source-http(webapi-http): tid(111): Operation state transition to up failed
20200128T044940.830Z [apiconnect][0x00330019][mgmt][error] source-http(webapi-internal-local): tid(111): Operation state transition to up failed
20200128T044940.854Z [apiconnect][0x00330019][mgmt][error] source-https(webapi-https): tid(111): Operation state transition to up failed

Related

Cloud Code for VisualStudio Code Errors on Cloud Code: Deploy

I've been trying to setup Cloud Code with VSCode and I've been running in to problems when starting the deploy process with Cloud Code: Deploy.
I've tried deploying the samples, python-hello-world-1 as well as the go-hello-world-1, to my kubernetes cluster on GKE but always end up getting errors when the deploy process starts package downloading:
Go Output
Running: skaffold run --enable-rpc -v info --rpc-http-port 49869 --filename skaffold.yaml --default-repo gcr.io/abx-lernende
starting gRPC server on port 50051
starting gRPC HTTP server on port 49869
Using kubectl context: gke_abx-lernende_europe-west4-a_joshu-test-cluster
Generating tags...
- go-hello-world -> gcr.io/abx-lernende/go-hello-world:latest
Checking cache...
- go-hello-world: Not found. Building
Building [go-hello-world]...
Sending build context to Docker daemon 57.86kB
Step 1/8 : FROM golang:1.13
---> 6586e3d10e96
Step 2/8 : RUN go get -u -v github.com/go-delve/delve/cmd/dlv
---> Running in b75ce8e5dae9
[91mgithub.com/go-delve/delve (download)
[0m[91m# cd .; git clone -- https://github.com/go-delve/delve /go/src/github.com/go-delve/delve
Cloning into '/go/src/github.com/go-delve/delve'...
fatal: unable to access 'https://github.com/go-delve/delve/': Failed to connect to github.com port 443: Connection refused
package github.com/go-delve/delve/cmd/dlv: exit status 128
[0mfailed to build: build failed: building [go-hello-world]: build artifact: unable to stream build output: The command '/bin/sh -c go get -u -v github.com/go-delve/delve/cmd/dlv' returned a non-zero code: 1
Exited with code 1.
Python Output
Running: skaffold run --enable-rpc -v info --rpc-http-port 50185 --filename
skaffold.yaml --default-repo gcr.io/abx-lernende
starting gRPC server on port 50051
starting gRPC HTTP server on port 50185
Skaffold &{Version:v1.3.1 ConfigVersion:skaffold/v2alpha3 GitVersion: GitCommit:6ba887a42438d1da578a005cf550e618fee6dfb8 GitTreeState:clean BuildDate:2020-01-31T19:55:18Z GoVersion:go1.13.4 Compiler:gc Platform:windows/amd64}
Using kubectl context: gke_abx-lernende_europe-west4-a_joshu-test-cluster
Generating tags...
- python-hello-world -> Tags generated in 0s
gcr.io/abx-lernende/python-hello-world:latest
Checking cache...
- python-hello-world: Cache check complete in 6.0001ms
Not found. Building
Building [python-hello-world]...
Sending build context to Docker daemon 4.608kB
Step 1/7 : FROM python:3.8
---> efdecc2e377a
Step 2/7 : WORKDIR /app
---> Using cache
---> a131b81cad66
Step 3/7 : COPY requirements.txt .
---> Using cache
---> 4625ef1862bd
Step 4/7 : RUN pip install --trusted-host pypi.python.org -r requirements.txt
---> Running in 4da23a158ae3
[91mWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f17ba9c9d60>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/flask/
Im assuming this is due to me being behind a corporate proxy. As counter measures I have explicitly configured VSCode, Git, pip, go and google cloud sdk all to use said proxy. On top of that I set the Windows ENV variables for the proxy. sadly without success.
Thanks!
You can configure docker to pass through proxy information into the containers by adding something like the following to your ~/.docker/config.json:
{
"proxies": {
"default": {
"httpProxy": "http://192.168.1.12:3128",
"httpsProxy": "http://192.168.1.12:3128"
}
}
}
Docker will set the HTTP_PROXY/HTTPS_PROXY environment variables within the container which is picked up by many tools.

Can't use dep/glide packages from docker file task in azure devops to build images from other repos. Host Key Verifiaction failed error

I'm trying to use docker container task in azure DevOps pipeline to build and push images to ACR and ECR. I am able to do that through a YAML file and automate all the processes but when I am trying the same with a docker file which has dep and glide packages to fetch from other repos both from public GitHub repos and private bitbucket repos. It fails with the Host Key Verification error. The same dockerfile works with Jenkins but I don't know how to solve this ssh-key error on a Hosted Ubuntu Agent.
Step 13/33 : RUN curl https://glide.sh/get | sh
---> Running in 26f7f0a19f91
% Total % Received % Xferd Average Speed Time Time Time Current‌
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0‌
0 4833 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0‌
100 4833 100 4833 0 0 6943 0 --:--:-- --:--:-- --:--:-- 6934
ARCH=amd64‌
OS=linux
Using curl as download tool
Getting https://glide.sh/version
TAG=v0.13.3
GLIDE_DIST=glide-v0.13.3-linux-amd64.tar.gz
Downloading https://github.com/Masterminds/glide/releases/download/v0.13.3/glide-v0.13.3-linux-amd64.tar.gz
glide version v0.13.3 installed successfully
Removing intermediate container 26f7f0a19f91
---> d4aa1a720fab
Step 14/33 : RUN glide update --strip-vendor
---> Running in 4614138d27bc
[INFO] ‌wnloading dependencies. Please wait...‌
[INFO] ‌> Fetching bitbucket.org/myrepositoryname/common‌
[INFO] ‌> Fetching github.com/golang/protobuf‌
[INFO] ‌> Fetching bitbucket.org/myrepositoryname/myteksi‌
[INFO] ‌> Fetching bitbucket.org/myrepositoryname/sdk‌
[INFO] ‌> Fetching github.com/imdario/mergo‌
[INFO] ‌> Fetching gopkg.in/go-playground/validator.v9‌
[INFO] ‌> Fetching github.com/segmentio/kafka-go‌
[WARN] ‌able to checkout bitbucket.org/myrepositoryname/common‌
[ERROR] ‌date failed for bitbucket.org/myrepositoryname/common: Unable to get repository: Cloning into '/root/.glide/cache/src/git-bitbucket.org-myrepositoryname-common.git'...‌
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
: exit status 128
Unable to get repository: Cloning into '/root/.glide/cache/src/git-bitbucket.org-myrepositoryname.git'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
: exit status 128
Unable to get repository: Cloning into '/root/.glide/cache/src/git-bitbucket.org-myrepositoryname.git'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
: exit status 128
The command '/bin/sh -c glide update --strip-vendor' returned a non-zero code: 1‌
##[debug]Exit code 1 received from tool '/usr/bin/docker'
##[debug]STDIO streams have closed for tool '/usr/bin/docker'
##[error]The command '/bin/sh -c glide update --strip-vendor' returned a non-zero code: 1
##[debug]Processed: ##vso[task.issue type=error;]The command '/bin/sh -c glide update --strip-vendor' returned a non-zero code: 1
##[debug]Trying to logout from registry: ***
##[debug]DOCKER_CONFIG=/home/vsts/work/_temp/DockerConfig_1564846219701
##[debug]agent.tempDirectory=/home/vsts/work/_temp
##[debug]Found the Docker Config stored in the temp path. Docker config path: /home/vsts/work/_temp/DockerConfig_1564846219701/config.json, Docker config: {"auths": { "***": {"auth": "***", "email": "ServicePrincipal#AzureRM" } }, "HttpHeaders":{"X-Meta-Source-Client":"VSTS"} }
##[debug]Deleting Docker config directory. Path: /home/vsts/work/_temp/DockerConfig_1564846219701/config.json
##[debug]DOCKER_CONFIG=/home/vsts/work/_temp/DockerConfig_1564846219701
##[debug]agent.tempDirectory=/home/vsts/work/_temp
##[debug]Deleting Docker config directory. Path: /home/vsts/work/_temp/DockerConfig_1564846219701
##[debug]set DOCKER_CONFIG=
##[debug]Processed: ##vso[task.setvariable variable=DOCKER_CONFIG;issecret=false;]
##[debug]task result: Failed
##[error]The process '/usr/bin/docker' failed with exit code 1
##[debug]Processed: ##vso[task.issue type=error;]The process '/usr/bin/docker' failed with exit code 1
##[debug]Processed: ##vso[task.complete result=Failed;]The process '/usr/bin/docker' failed with exit code 1
package: bitbucket.org/grabpay/ignite
import:
- package: bitbucket.org/myrepositoryname/common
repo: git#bitbucket.org:myrepositoryname/common.git
version: devel
subpackages:
- crimson
- track
- package: bitbucket.org/myrepositoryname/myfolder1
repo: git#bitbucket.org:myrepositoryname/myfolder1.git
version: fface9afbb72a739d0de8c8969e0fa06fda44614
- package: bitbucket.org/myrepositoryname/myfolder2
repo: git#bitbucket.org:myrepositoryname/myfolder2.git
version: master
- package: github.com/imdario/mergo
version: 2b9c8687f09d230f37f169eea24e1951bb7d1191
- package: gopkg.in/go-playground/validator.v9
- package: github.com/segmentio/kafka-go
- package: github.com/golang/protobuf
version: ^1.3.1
The above file is the dependency repos that are to be fetched using glide.yml file.
I fixed it finally, what I needed was a service account which has read access to all the repos that glide is trying to access. Read access was required for all those repos with a Bitbucket Service Connection in Azure Pipeline. The error is not specific to glide, it is more inclined with the git repo access.

How to fix "returned a non-zero code: 7" when building docker image

I'm a newer to Docker, when i follow https://docs.confluent.io/current/installation/docker/development.html#create-a-docker-image-containing-local-connectors to build a Docker image with local connector, i got some issue.
below is my Dockerfile:
FROM confluentinc/cp-kafka-connect-base:5.3.0
COPY kafka-connect-solr-sink-0.0.1.zip /tmp/kafka-connect-solr-sink-0.0.1.zip
RUN confluent-hub install --no-prompt /tmp/kafka-connect-solr-sink-0.0.1.zip
when I run "docker build . -t my-custom-image:1.0.0", got below error:
Sending build context to Docker daemon 6.876MB Step 1/3 : FROM
confluentinc/cp-kafka-connect-base:5.3.0 ---> b1491496b48d Step 2/3 :
COPY kafka-connect-solr-sink-0.0.1.zip
/tmp/kafka-connect-solr-sink-0.0.1.zip ---> Using cache --->
85689e66c40a Step 3/3 : RUN confluent-hub install --no-prompt
/tmp/kafka-connect-solr-sink-0.0.1.zip ---> Running in 1d3486732517
Running in a "--no-prompt" mode Failed to unzip
'/tmp/kafka-connect-solr-sink-0.0.1.zip' into
'/tmp/confluent-hub-tmp7724578044817786588' String index out of range:
-1
Error: Unknown error The command '/bin/sh -c confluent-hub install
--no-prompt /tmp/kafka-connect-solr-sink-0.0.1.zip' returned a non-zero code: 7
Anyone can kindly help on this? Thanks.
From the Docker file ,Ensure you set the required proxy settings so that you do not get this error.
In Dockerfile....
ENV http_proxy <proxy_host>:
ENV https_proxy <proxy_host>:
After adding this before running other commands it

Installing py27-scipy not working for py27-cairo using macports

(graphite)[nai:~]$ sudo port install py27-cairo
---> Computing dependencies for py27-cairo
---> Cleaning py27-cairo
---> Scanning binaries for linking errors: 100.0%
---> Found 5 broken file(s), matching files to ports
---> Found 3 broken port(s), determining rebuild order
---> Rebuilding in order
py27-scipy #0.10.1 +gcc45
qemu #1.4.0 +target_i386+target_x86_64
qt4-mac #4.8.3 +quartz
---> Computing dependencies for py27-scipy
---> Fetching archive for py27-scipy
---> Attempting to fetch py27-scipy-0.12.0_2+gcc45.darwin_11.x86_64.tbz2 from http://jog.id.packages.macports.org/macports/packages/py27-scipy
---> Attempting to fetch py27-scipy-0.12.0_2+gcc45.darwin_11.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/py27-scipy
---> Attempting to fetch py27-scipy-0.12.0_2+gcc45.darwin_11.x86_64.tbz2 from http://packages.macports.org/py27-scipy
---> Fetching distfiles for py27-scipy
---> Attempting to fetch scipy-0.12.0.tar.gz from http://jog.id.distfiles.macports.org/macports/mpdistfiles/py-scipy/0.12.0_1
---> Verifying checksum(s) for py27-scipy
---> Extracting py27-scipy
---> Applying patches to py27-scipy
---> Configuring py27-scipy
---> Building py27-scipy
^[[BError: org.macports.build for port py27-scipy returned: command execution failed
Please see the log file for port py27-scipy for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-scipy/py27-scipy/main.log
Error: Unable to upgrade port: 1
Error rebuilding py27-scipy
while executing
"error "Error rebuilding $portname""
(procedure "revupgrade_scanandrebuild" line 382)
invoked from within
"revupgrade_scanandrebuild broken_port_counts $opts"
(procedure "macports::revupgrade" line 5)
invoked from within
"macports::revupgrade $opts"
(procedure "action_revupgrade" line 2)
invoked from within
"action_revupgrade $action $portlist $opts"
(procedure "action_target" line 94)
invoked from within
"$action_proc $action $portlist [array get global_options]"
(procedure "process_cmd" line 95)
invoked from within
"process_cmd $remaining_args"
invoked from within
"if { [llength $remaining_args] > 0 } {
# If there are remaining arguments, process those as a command
set exit_status [process_cmd $remaining..."
(file "/opt/local/bin/port" line 4785)
So I have py27-scipy installed
(graphite)[nai:~]$ port installed py27-scipy
The following ports are currently installed:
py27-scipy #0.10.1_3+gcc45 (active)
Running
[nai:~]$ sudo port clean py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
followed by a
[nai:~]$ sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
I ran port self update and it probably broke some stuff.

MacPorts Error When Installing GDBM

When I attempt to run the command sudo port install gdbm, the output is as follows:
---> Fetching archive for gdbm
---> Attempting to fetch gdbm-1.10_0+universal.darwin_11.i386-x86_64.tbz2 from http://packages.macports.org/gdbm
---> Fetching gdbm
---> Verifying checksum(s) for gdbm
---> Extracting gdbm
---> Configuring gdbm
---> Building gdbm
---> Staging gdbm into destroot
Error: Target org.macports.destroot returned: /opt/local/lib/libgdbm.la differs in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_databases_gdbm/gdbm/work/destroot-i386 and /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_databases_gdbm/gdbm/work/destroot-x86_64 and cannot be merged
Log for gdbm is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_databases_gdbm/gdbm/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade pkgconfig failed
To report a bug, see <http://guide.macports.org/#project.tickets>`
WHYYYYY????
See Log:
http://pastebin.com/8s0MgHbR