FN Hello World App 8080 Connection Issues - fn

I'm following the Introduction to Fn with Python Tutorial here. I'm on Mac Catalina 10.15.7.
When I run the command "fn create app pythonapp" in my terminal, I receive the error
Fn: Post "http://127.0.0.1:8080/v2/apps": dial tcp 127.0.0.1:8080: connect: connection refused
I tried the solution explain here but it didn't fix the problem.
When I run "fn version" this is my output.
Client version is latest version: 0.6.1
Server version: ?
If I run "fn start" this is my output.
020/12/14 10:29:57 ¡¡¡ 'fn start' should NOT be used for PRODUCTION !!! see https://github.com/fnproject/fn-helm/
time="2020-12-14T18:29:57Z" level=info msg="Setting log level to" fields.level=info
time="2020-12-14T18:29:57Z" level=info msg="Registering data store provider 'sql'"
time="2020-12-14T18:29:57Z" level=info msg="Connecting to DB" url="sqlite3:///app/data/fn.db"
time="2020-12-14T18:29:57Z" level=info msg="datastore dialed" datastore=sqlite3 max_idle_connections=256 url="sqlite3:///app/data/fn.db"
time="2020-12-14T18:29:57Z" level=info msg="agent starting cfg={MinDockerVersion:17.10.0-ce ContainerLabelTag: DockerNetworks: DockerLoadFile: DisableUnprivilegedContainers:false FreezeIdle:50ms HotPoll:200ms HotLauncherTimeout:1h0m0s HotPullTimeout:10m0s HotStartTimeout:5s DetachedHeadRoom:6m0s MaxResponseSize:0 MaxHdrResponseSize:0 MaxLogSize:1048576 MaxTotalCPU:0 MaxTotalMemory:0 MaxFsSize:0 MaxPIDs:50 MaxOpenFiles:0xc42020cb98 MaxLockedMemory:0xc42020cbb0 MaxPendingSignals:0xc42020cbb8 MaxMessageQueue:0xc42020cbc0 PreForkPoolSize:0 PreForkImage:busybox PreForkCmd:tail -f /dev/null PreForkUseOnce:0 PreForkNetworks: EnableNBResourceTracker:false MaxTmpFsInodes:0 DisableReadOnlyRootFs:false DisableDebugUserLogs:false IOFSEnableTmpfs:false EnableFDKDebugInfo:false IOFSAgentPath:/iofs IOFSMountRoot:/Users/shaymasirving/.fn/iofs IOFSOpts: ImageCleanMaxSize:0 ImageCleanExemptTags: ImageEnableVolume:false}"
time="2020-12-14T18:29:57Z" level=info msg="no docker auths from config files found (this is fine)" error="open /root/.dockercfg: no such file or directory"
time="2020-12-14T18:29:57Z" level=info msg="available memory" cgroup_limit=9223372036854771712 head_room=268435456 total_memory=1077936128
time="2020-12-14T18:29:57Z" level=info msg="ram reservations" avail_memory=809500672
time="2020-12-14T18:29:57Z" level=info msg="available cpu" avail_cpu=8000 total_cpu=8000
time="2020-12-14T18:29:57Z" level=info msg="cpu reservations" cpu=8000
time="2020-12-14T18:29:57Z" level=info msg="\n ______\n / ____/___\n / /_ / __ \\\n / __/ / / / /\n /_/ /_/ /_/\n"
time="2020-12-14T18:29:57Z" level=info msg="Fn serving on `:8080`" type=full version=0.3.749

Related

Bootstrap InfluxDB 2 in a docker container with pre-existing influx-configs file?

I'd like to run InfluxDB2 in a docker container in Kubernetes, and I'd like to avoid having to manually setup a user. I do know from https://hub.docker.com/_/influxdb that it's possible to do this using environment variables, and I've made that work, but I'd like to do this using a kubernetes secret instead and mount that as the file /etc/influxdb2/influx-configs in the container.
I have this secret:
apiVersion: v1
kind: Secret
metadata:
name: influxdb-org-user-auth-secret
stringData:
influx-configs: |+
[default]
url = "http://localhost:8086"
token = "token_token_token_token"
org = "initial_organization"
active = true
And I'm mounting it like this in my statefulset:
...
volumeMounts:
- name: influxdb-org-user-auth
readOnly: true
mountPath: "/etc/influxdb2"
...
volumes:
- name: influxdb-org-user-auth
secret:
secretName: influxdb-org-user-auth-secret
And this seems to work. If I go into the container I can see this:
I have no name!#influxdb-0:/$ cat /etc/influxdb2/influx-configs
[default]
url = "http://localhost:8086"
token = "token_token_token_token"
org = "initial_organization"
active = true
I can also see that it seems to be a symbolic link:
I have no name!#influxdb-0:/$ ls -ahl /etc/influxdb2/influx-configs
lrwxrwxrwx 1 root 20000 21 May 5 10:49 /etc/influxdb2/influx-configs -> ..data/influx-configs
However, if I port forward (kubectl -n observability port-forward influxdb-0 8086:8086) and open browser at http://localhost:8086 I'm redirected to http://localhost:8086/onboarding/0, which seems to indicate that my efforts failed.
Here are the initial logs of the influxdb container:
chmod: changing permissions of '/var/lib/influxdb2': Operation not permitted
chmod: changing permissions of '/etc/influxdb2': Read-only file system
2022-05-05T10:49:57.580064860Z warn boltdb not found at configured path, but DOCKER_INFLUXDB_INIT_MODE not specified, skipping setup wrapper {"system": "docker", "bolt_path": ""}
ts=2022-05-05T10:49:57.703727Z lvl=info msg="Welcome to InfluxDB" log_id=0aGyIUml000 version=2.1.1 commit=657e1839de build_date=2021-11-09T03:03:48Z
ts=2022-05-05T10:49:57.707452Z lvl=info msg="Resources opened" log_id=0aGyIUml000 service=bolt path=/var/lib/influxdb2/influxd.bolt
ts=2022-05-05T10:49:57.707518Z lvl=info msg="Resources opened" log_id=0aGyIUml000 service=sqlite path=/var/lib/influxdb2/influxd.sqlite
ts=2022-05-05T10:49:57.708371Z lvl=info msg="Bringing up metadata migrations" log_id=0aGyIUml000 service="KV migrations" migration_count=18
ts=2022-05-05T10:49:57.797799Z lvl=info msg="Bringing up metadata migrations" log_id=0aGyIUml000 service="SQL migrations" migration_count=3
ts=2022-05-05T10:49:57.805939Z lvl=info msg="Using data dir" log_id=0aGyIUml000 service=storage-engine service=store path=/var/lib/influxdb2/engine/data
ts=2022-05-05T10:49:57.805974Z lvl=info msg="Compaction settings" log_id=0aGyIUml000 service=storage-engine service=store max_concurrent_compactions=8 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
ts=2022-05-05T10:49:57.805986Z lvl=info msg="Open store (start)" log_id=0aGyIUml000 service=storage-engine service=store op_name=tsdb_open op_event=start
ts=2022-05-05T10:49:57.806024Z lvl=info msg="Open store (end)" log_id=0aGyIUml000 service=storage-engine service=store op_name=tsdb_open op_event=end op_elapsed=0.037ms
ts=2022-05-05T10:49:57.806043Z lvl=info msg="Starting retention policy enforcement service" log_id=0aGyIUml000 service=retention check_interval=30m
ts=2022-05-05T10:49:57.806049Z lvl=info msg="Starting precreation service" log_id=0aGyIUml000 service=shard-precreation check_interval=10m advance_period=30m
ts=2022-05-05T10:49:57.806082Z lvl=info msg="Starting query controller" log_id=0aGyIUml000 service=storage-reads concurrency_quota=1024 initial_memory_bytes_quota_per_query=9223372036854775807 memory_bytes_quota_per_query=9223372036854775807 max_memory_bytes=0 queue_size=1024
ts=2022-05-05T10:49:57.806839Z lvl=info msg="Configuring InfluxQL statement executor (zeros indicate unlimited)." log_id=0aGyIUml000 max_select_point=0 max_select_series=0 max_select_buckets=0
ts=2022-05-05T10:49:58.091674Z lvl=info msg=Listening log_id=0aGyIUml000 service=tcp-listener transport=http addr=:8086 port=8086
ts=2022-05-05T10:49:58.091705Z lvl=info msg=Starting log_id=0aGyIUml000 service=telemetry interval=8h
Should this be possible? If so, what am I missing? Thanks for reading!
(Also asked here: https://github.com/influxdata/influxdata-docker/issues/611)

Getting error 'failed to execute when condition: cannot fetch phase from <nil>' with Argo CD notifications

I have installed a brand-new Argo CD (v2.1.7) and notifications (v1.2.0). I configured it to send me a Slack message and subscribed my application to the on-deployed trigger using the following annotation:
annotations:
notifications.argoproj.io/subscribe.on-deployed.slack: my_channel
When I deploy my application, the log output of the argocd-notifications-controller is:
time="2021-12-10T12:18:23Z" level=error msg="failed to execute oncePer condition: cannot fetch syncResult from <nil> (1:27)\n | app.status.operationState.syncResult.revision\n | ..........................^"
time="2021-12-10T12:18:23Z" level=info msg="Trigger on-deployed result: [{[0].y7b5sbwa2Q329JYH755peeq-fBs [app-deployed] false}]" resource=argocd/ah-ctp-argocd-test
time="2021-12-10T12:18:23Z" level=info msg="Processing completed" resource=argocd/ah-ctp-argocd-test
time="2021-12-10T12:19:21Z" level=info msg="Start processing" resource=argocd/ah-ctp-argocd-test
time="2021-12-10T12:19:21Z" level=error msg="failed to execute when condition: cannot fetch phase from <nil> (1:27)\n | app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy'\n | ..........................^"
As a test, I changed the when condition to when: true and added {{ .app }} to the message body, then re-deployed. I received the notification in Slack, however {{ .app }} does not contain operationState. It does contain, for instance app.status.health.status and its value is 'Healthy'.
I see no one has posted any similar error online, which leads me to think I must be doing something wrong. Does anyone have any advice?
Okay, so this was a PEDKAC error. I received a notification the first time, but never again. It turns out that Argo CD keeps track for which commits it has sent notifications. The problem was that I was deleting and redeploying the app in Argo CD, but it was always the same commit. When I created a new commit and deployed from that, the notifications came through as expected.
For me the same errors appeared when I had wrong values in the arocd-notifications-cm config map.
I was using unquoted value for apiURL which I was not using anyways. Once I removed (commented) the apiURL entry in service.slack, everything started working well.

Cannot retrieve needed files for okteto on Windows behind proxy

I'm trying to deploy okteto environment on Visual Studio Code to use Remote Development on Kubernetes.
Following the official steps (https://okteto.com/blog/remote-kubernetes-development/), I executed "Okteto: up" and selected manifest(vscode-remote-go/okteto.yml), but got this error:
Installing dependencies...
x couldn't download syncthing, please try again
By changing the log level, I also got these logs:
C:\Users\user\AppData\Local\Programs\okteto.exe up -f 'c:\Workspace\...my_project...\vscode-remote-go\okteto.yml' --remote '22100' --loglevel=debug
time="2021-09-13T14:09:32+09:00" level=info msg="starting up command"
time="2021-09-13T14:09:32+09:00" level=info msg="failed to get latest version from github: fail to get releases from github: Get \"https://api.github.com/repos/okteto/okteto/releases?per_page=5\": dial tcp: lookup api.github.com: no such host"
Installing dependencies...
time="2021-09-13T14:09:32+09:00" level=info msg="installing syncthing for windows/amd64"
time="2021-09-13T14:09:32+09:00" level=info msg="failed to download syncthing, retrying: failed to download syncthing from https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-windows-amd64-v1.10.0.zip: Get \"https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-windows-amd64-v1.10.0.zip\": dial tcp: lookup github.com: no such host"
time="2021-09-13T14:09:33+09:00" level=info msg="installing syncthing for windows/amd64"
time="2021-09-13T14:09:33+09:00" level=info msg="failed to download syncthing, retrying: failed to download syncthing from https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-windows-amd64-v1.10.0.zip: Get \"https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-windows-amd64-v1.10.0.zip\": dial tcp: lookup github.com: no such host"
time="2021-09-13T14:09:34+09:00" level=info msg="installing syncthing for windows/amd64"
time="2021-09-13T14:09:34+09:00" level=info msg="failed to upgrade syncthing: failed to download syncthing from https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-windows-amd64-v1.10.0.zip: Get \"https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-windows-amd64-v1.10.0.zip\": dial tcp: lookup github.com: no such host"
time="2021-09-13T14:09:34+09:00" level=info msg="couldn't download syncthing, please try again"
x couldn't download syncthing, please try again
This environment is behind my corporate proxy, and okteto.exe may not use Windows proxy setting. When I directly enter the URL (https://github.com/syncthing/syncthing/releases/download/v1.10.0/syncthing-windows-amd64-v1.10.0.zip) it can be downloaded using proxy.
Is it possible to use okteto behind proxy?
Using a proxy is not currently supported in the Okteto. We're looking into it though.
For now, a workaround is to manually download the syncthing binary and save it as%HOME%\.okteto\syncthing.exe

JMX Connection refused on Kubernetes with AdoptOpenJDK OpenJ9

With my team we are trying to move our micro-services to openj9, they are running on kubernetes. However, we encounter a problem on the configuration of JMX. (openjdk8-openj9)
We have a connection refused when we try a connection with jvisualvm (and a port-forwarding with Kubernetes).
We haven't changed our configuration, except for switching from Hotspot to OpenJ9.
The error :
E0312 17:09:46.286374 17160 portforward.go:400] an error occurred forwarding 1099 -> 1099: error forwarding port 1099 to pod XXXXXXX, uid : exit status 1: 2020/03/12 16:09:45 socat[31284] E connect(5, AF=2 127.0.0.1:1099, 16): Connection refused
The java options that we use :
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.rmi.port=1099
We are using the last adoptopenjdk/openjdk8-openj9 docker image.
Do you have any ideas?
Thank you !
Regards.
I managed to figure out why it wasn't working.
It turns out that to pass the JMX options to the service we were using the Kubernetes service descriptor in YAML. It looks like this:
- name: _JAVA_OPTIONS
value: -Dzipkinserver.listOfServers=http://zipkin:9411 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099
I realized that the JMX properties were not taken into account from _JAVA_OPTIONS when the application is not launch with ENTRYPOINT in the docker container.
So I pass the properties directly into the Dockerfile like this and it works.
CMD ["java", "-Dcom.sun.management.jmxremote", "-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.port=1099", "-Dcom.sun.management.jmxremote.rmi.port=1099", "-Djava.rmi.server.hostname=127.0.0.1", "-cp","app:app/lib/*","OurMainClass"]
It's also possible to keep _JAVA_OPTIONS and setup an ENTRYPOINT in the dockerfile.
Thanks!

Error reading manifest file in bluemix deploy

I'm having a hard time to deploy this standard ecommerce project on Bluemix:
https://github.com/zallaricardo/ecommerce-devops
I've chosen to do it with git repository and automatic deploy through the Bluemix pipeline service. After successfully building and fixing a lot of misconfigurations, the root challenge seems to be write a correct version of the manifest.yml file for the project.
Without the manifest.yml file, the log shows the following error:
Downloading artifacts...DOWNLOAD SUCCESSFUL
Target: https://api.ng.bluemix.net
Updating app loja-virtual-devops in org pfc-devops / space Dev as [email account]...
OK
Uploading loja-virtual-devops...
Uploading app files from: /home/pipeline/d38f0184-33da-44da-ba16-4671b491988a
Uploading 384.1M, 1679 files
228.5M uploaded...
Done uploading
OK
Stopping app loja-virtual-devops in org pfc-devops / space Dev as [email account]...
OK
Starting app loja-virtual-devops in org pfc-devops / space Dev as[email account]...
-----> Downloaded app package (452M)
-----> Downloaded app buildpack cache (4.0K)
Staging failed: An application could not be detected by any available buildpack
FAILED
NoAppDetectedError
TIP: Buildpacks are detected when the "cf push" is executed from within the directory that contains the app source code.
Use 'cf buildpacks' to see a list of supported buildpacks.
Use 'cf logs loja-virtual-devops --recent' for more in depth log information.
And with the version of manifest which I believe * - I'm new on this manifests stuff* - to be ok and sufficient, the log shows:
Downloading artifacts...DOWNLOAD SUCCESSFUL
Target: https://api.ng.bluemix.net
FAILED
Error reading manifest file:
yaml: unmarshal errors:
line 2: cannot unmarshal !!seq into map[interface {}]interface {}
The manifest.yml file is currently written as follows:
---
- name: loja-virtual-devops
memory: 512M
buildpack: https://github.com/cloudfoundry/java-buildpack
domain: mybluemix.net
I'll sincerely appreciate any hint about how to fix the manifest for this application or another way to successfully deploy the project through Bluemix.
Try including the applications heading in your manifest.yml file.
example:
applications:
- name: appname
host: app_hostname
buildpack: java_buildpack
instances: 2
memory: 512M
disk_quota: 512M
path: .