Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install error #202

Open
justzx2011 opened this issue Feb 28, 2023 · 8 comments
Open

install error #202

justzx2011 opened this issue Feb 28, 2023 · 8 comments

Comments

@justzx2011
Copy link

my k8s version is v1.25.6+k3s1
error message:
helm install sreworks ./ --create-namespace --namespace sreworks --set global.accessMode="nodePort" --set appmanager.home.url="http://127.0.0.1:30767" --set saas.onlyBase=true
Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "local-path-provisioner-role" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "sreworks"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "sreworks"

@Twwy
Copy link
Collaborator

Twwy commented Feb 28, 2023

看起来默认的storageclass供应方案和您已安装的local-path-provisioner冲突了。
请使用您集群已有的storageclass即可。

--set global.storageClass="***"

@justzx2011
Copy link
Author

k get storageclass -A
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 81m

helm install sreworks ./ --create-namespace --namespace sreworks --set global.accessMode="nodePort" --set appmanager.home.url="http://127.0.0.1:30767" --set saas.onlyBase=true --set global.storageClass="local-path"
Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "local-path-provisioner-role" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "sreworks"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "sreworks"

@justzx2011
Copy link
Author

justzx2011 commented Mar 1, 2023

my k8s create by rancher desktop on mac m1,

after delete storageClass、clusterrole,i can install,but:

k logs sreworks-core-init-job-7fnkn -n sreworks
Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused

  • read line
  • python3 /root/plugins/pack.py -f /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1/ -t /tmp/plugin
    /tmp/plugin.zip
  • /root/swcli plugin upload --config /swcli/swcli.yaml '--filepath=/tmp/plugin.zip' '--overwrite=true'
    Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • rm /tmp/plugin.zip
  • cat /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1//definition.yaml
  • awk '{print $NF}'
  • awk -F '"' '{print $2}'
  • grep definition.oam.dev/version
  • version=1.0.7
  • echo traits/service-gateway.trait.sreworks.io/v1beta1/
  • awk -F / '{print $2"/"$3}'
    1.0.7
  • name=service-gateway.trait.sreworks.io/v1beta1
  • echo 1.0.7
  • echo service-gateway.trait.sreworks.io/v1beta1
    service-gateway.trait.sreworks.io/v1beta1
  • /root/swcli plugin operate --config /swcli/swcli.yaml '--name=service-gateway.trait.sreworks.io/v1beta1' '--version=1.0.7' '--operation=enable'
    Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • read line
  • echo 'all the plugins upload to the appmanager'
    all the plugins upload to the appmanager
  • cd /root/saas/swcore/api/core/
  • cat /run/secrets/kubernetes.io/serviceaccount/namespace
  • export 'NAMESPACE_ID=sreworks'
  • '[[' false '==' true ]]
  • python /app/patch_meta_yaml.py /root/saas/swcore/build
  • python /app/pack.py --src /root/saas/swcore/build --dest /root/saas/swcore/build.zip
  • '[[' nodePort '==' ingress ]]
  • envsubst
  • /root/swcli --config /swcli/swcli.yaml app-package import '--app-id=flycore' --filepath /root/saas/swcore/build.zip '--print-only-app-package-id=true' '--reset-version=true'
    Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • result=
    bjzhangxin@MacBook-Pro-3 sreworks-chart % k get pod -n sreworks|egrep -v "Running"
    NAME READY STATUS RESTARTS AGE
    sreworks-core-init-job-7fnkn 0/1 CrashLoopBackOff 5 (106s ago) 4m53s
    sreworks-appmanager-cluster-initjob-lbk7r 0/1 CrashLoopBackOff 8 (87s ago) 31m

k logs sreworks-appmanager-cluster-initjob-lbk7r -n sreworks

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/sbin/cluster_init.py", line 165, in
init_cluster(AppManagerClient(ENDPOINT, CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD).client)
File "/app/sbin/cluster_init.py", line 75, in init
self._token = self._fetch_token()
File "/app/sbin/cluster_init.py", line 86, in _fetch_token
return oauth.fetch_token(
File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 341, in fetch_token
r = self.request(
File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 521, in request
return super(OAuth2Session, self).request(
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='sreworks-appmanager', port=80): Max retries exceeded with url: /oauth/token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x400364a340>: Failed to establish a new connection: [Errno 111] Connection refused'))

curl http://127.0.0.1:30767/
curl: (7) Failed to connect to 127.0.0.1 port 30767 after 4 ms: Connection refused

@Twwy
Copy link
Collaborator

Twwy commented Mar 1, 2023

k get storageclass -A NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 81m

helm install sreworks ./ --create-namespace --namespace sreworks --set global.accessMode="nodePort" --set appmanager.home.url="http://127.0.0.1:30767" --set saas.onlyBase=true --set global.storageClass="local-path" Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "local-path-provisioner-role" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "sreworks"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "sreworks"

不好意思,还差个参数

--set global.storageClass="***" \
--set localPathProvisioner=false

@Twwy
Copy link
Collaborator

Twwy commented Mar 1, 2023

my k8s create by rancher desktop on mac m1,

after delete storageClass、clusterrole,i can install,but:

k logs sreworks-core-init-job-7fnkn -n sreworks Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused

  • read line
  • python3 /root/plugins/pack.py -f /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1/ -t /tmp/plugin
    /tmp/plugin.zip
  • /root/swcli plugin upload --config /swcli/swcli.yaml '--filepath=/tmp/plugin.zip' '--overwrite=true'
    Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • rm /tmp/plugin.zip
  • cat /root/plugins/traits/service-gateway.trait.sreworks.io/v1beta1//definition.yaml
  • awk '{print $NF}'
  • awk -F '"' '{print $2}'
  • grep definition.oam.dev/version
  • version=1.0.7
  • echo traits/service-gateway.trait.sreworks.io/v1beta1/
  • awk -F / '{print $2"/"$3}'
    1.0.7
  • name=service-gateway.trait.sreworks.io/v1beta1
  • echo 1.0.7
  • echo service-gateway.trait.sreworks.io/v1beta1
    service-gateway.trait.sreworks.io/v1beta1
  • /root/swcli plugin operate --config /swcli/swcli.yaml '--name=service-gateway.trait.sreworks.io/v1beta1' '--version=1.0.7' '--operation=enable'
    Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • read line
  • echo 'all the plugins upload to the appmanager'
    all the plugins upload to the appmanager
  • cd /root/saas/swcore/api/core/
  • cat /run/secrets/kubernetes.io/serviceaccount/namespace
  • export 'NAMESPACE_ID=sreworks'
  • '[[' false '==' true ]]
  • python /app/patch_meta_yaml.py /root/saas/swcore/build
  • python /app/pack.py --src /root/saas/swcore/build --dest /root/saas/swcore/build.zip
  • '[[' nodePort '==' ingress ]]
  • envsubst
  • /root/swcli --config /swcli/swcli.yaml app-package import '--app-id=flycore' --filepath /root/saas/swcore/build.zip '--print-only-app-package-id=true' '--reset-version=true'
    Error: Post "http://sreworks-appmanager/oauth/token": dial tcp 10.43.92.52:80: connect: connection refused
  • result=
    bjzhangxin@MacBook-Pro-3 sreworks-chart % k get pod -n sreworks|egrep -v "Running"
    NAME READY STATUS RESTARTS AGE
    sreworks-core-init-job-7fnkn 0/1 CrashLoopBackOff 5 (106s ago) 4m53s
    sreworks-appmanager-cluster-initjob-lbk7r 0/1 CrashLoopBackOff 8 (87s ago) 31m

k logs sreworks-appmanager-cluster-initjob-lbk7r -n sreworks

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/sbin/cluster_init.py", line 165, in init_cluster(AppManagerClient(ENDPOINT, CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD).client) File "/app/sbin/cluster_init.py", line 75, in init self._token = self._fetch_token() File "/app/sbin/cluster_init.py", line 86, in _fetch_token return oauth.fetch_token( File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 341, in fetch_token r = self.request( File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 521, in request return super(OAuth2Session, self).request( File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 565, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='sreworks-appmanager', port=80): Max retries exceeded with url: /oauth/token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x400364a340>: Failed to establish a new connection: [Errno 111] Connection refused'))

curl http://127.0.0.1:30767/ curl: (7) Failed to connect to 127.0.0.1 port 30767 after 4 ms: Connection refused

先看一下内置mysql是否起来,然后appmanager这个pod有没有running。这里大概需要等待5-10分钟左右。在appmanager pod running了之后,这个sreworks-core-init-job才能够成功注入底座应用。如果还有问题。麻烦kubectl get pod -nsrewors截取贴一下。

@justzx2011
Copy link
Author

justzx2011 commented Mar 1, 2023

image

k logs sreworks-appmanager-cluster-initjob-qfmbt -n sreworks

image

@justzx2011
Copy link
Author

image

@Twwy
Copy link
Collaborator

Twwy commented Mar 2, 2023

image

看起来是appmanager启动有问题,您方便把appmanager的日志dump出来发一下吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants