seaweedfs / seaweedfs-csi-driver

SeaweedFS CSI Driver https://github.com/seaweedfs/seaweedfs
Apache License 2.0
218 stars 50 forks source link

CSI driver doesn't log any errors #14

Open optix2000 opened 3 years ago

optix2000 commented 3 years ago

Debugging the CSI driver is annoying as it doesn't log anything on failure (or success). This can be trivially be tested by:

  1. Running kubectl apply -f https://github.com/seaweedfs/seaweedfs-csi-driver/blob/master/deploy/kubernetes/seaweedfs-csi.yaml with a bogus SEAWEEDFS_FILER value. (or make sure that seaweedfs isn't accessible on the default value of 192.168.2.7:8888. 2.kubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-csi-driver/master/deploy/kubernetes/sample-seaweedfs-pvc.yaml to trigger a pv provision. 3 Checking logs by running kubectl -n kube-system logs statefulset/csi-seaweedfs-controller seaweedfs-csi-plugin and kubectl -n kube-system logs daemonset/csi-seaweedfs-node csi-seaweedfs-plugin

This results in absolutely no logs signifying there is something wrong, aside from the pvc pending forever and the csi-provisioner throwing timeouts.

# ping 192.168.2.7
PING 192.168.2.7 (192.168.2.7) 56(84) bytes of data.
^C
--- 192.168.2.7 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
# kubectl -n kube-system logs statefulset/csi-seaweedfs-controller seaweedfs-csi-plugin
I0215 09:40:19     1 main.go:34] connect to filer 192.168.2.7:8888
I0215 09:40:19     1 driver.go:45] Driver: seaweedfs-csi-driver version: 1.0.0
I0215 09:40:19     1 driver.go:91] Enabling volume access mode: SINGLE_NODE_WRITER
I0215 09:40:19     1 driver.go:91] Enabling volume access mode: MULTI_NODE_MULTI_WRITER
I0215 09:40:19     1 driver.go:102] Enabling controller service capability: CREATE_DELETE_VOLUME
I0215 09:40:19     1 driver.go:102] Enabling controller service capability: PUBLISH_UNPUBLISH_VOLUME
I0215 09:40:19     1 server.go:92] Listening for connections on address: &net.UnixAddr{Name:"//var/lib/csi/sockets/pluginproxy/csi.sock", Net:"unix"}
# kubectl -n kube-system logs daemonset/csi-seaweedfs-node csi-seaweedfs-plugin
I0215 09:40:19     1 main.go:34] connect to filer 192.168.2.7:8888
I0215 09:40:19     1 driver.go:45] Driver: seaweedfs-csi-driver version: 1.0.0
I0215 09:40:19     1 driver.go:91] Enabling volume access mode: SINGLE_NODE_WRITER
I0215 09:40:19     1 driver.go:91] Enabling volume access mode: MULTI_NODE_MULTI_WRITER
I0215 09:40:19     1 driver.go:102] Enabling controller service capability: CREATE_DELETE_VOLUME
I0215 09:40:19     1 driver.go:102] Enabling controller service capability: PUBLISH_UNPUBLISH_VOLUME
I0215 09:40:19     1 server.go:92] Listening for connections on address: &net.UnixAddr{Name:"//csi/csi.sock", Net:"unix"}

This can speed up debugging issues like #10, #7, https://github.com/seaweedfs/seaweedfs-csi-driver/pull/8#issuecomment-758262143 or any other connectivity issues.

chrislusf commented 3 years ago

Please let me know how to add additional logs. A PR is welcome.

ustuzhanin commented 3 years ago

There was a mistake in the names of the driver, try the chart

ustuzhanin commented 3 years ago

https://github.com/seaweedfs/seaweedfs-csi-driver/tree/master/deploy/helm/seaweedfs-csi-driver

chrislusf commented 3 years ago

https://github.com/seaweedfs/seaweedfs-csi-driver/tree/master/deploy/helm/seaweedfs-csi-driver

@ustuzhanin you can also add the instructions on how to apply the helm charts to the project's README.md

ustuzhanin commented 3 years ago

ok, in week do it

ustuzhanin commented 3 years ago

but for better use - need upload chart in anyone helm repo. we use private nexus. How in there - dont now. Need research

unixfox commented 3 years ago

but for better use - need upload chart in anyone helm repo. we use private nexus. How in there - dont now. Need research

You can publish a helm chart through GitHub pages: https://github.com/helm/chart-releaser

ustuzhanin commented 3 years ago

ok, read. Now: https://github.com/seaweedfs/seaweedfs-csi-driver/pull/16

nicned commented 2 years ago

Hi Guys, is the Seaweedfs CSI driver logging now? I see this issue is still open...

We are trying to troubleshoot an issue, but we don't seem to be able to come across any logs from the driver. I am talking about the log from this seaweedfs-csi-driver process that, as you can see, produces a lot of defunct weed processes.

$ sudo ps -Afw --forest | grep weed
root     15740 15647  0 Jul03 ?        00:00:14              |   \_ /csi-node-driver-registrar --v=5 --csi-address=/csi/csi.sock --kubelet-registration-path=/var/lib/kubelet/plugins/seaweedfs-csi-driver/csi.sock
root     16251 16195  0 Jul03 ?        00:00:26              |   \_ /seaweedfs-csi-driver --endpoint=unix:///csi/csi.sock --filer=127.0.0.1:5555 --nodeid=e10ccwe080c000001127
root     16996 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     17307 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     17670 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     18039 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     18421 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     18965 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     19737 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     20998 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     23119 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     26735 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root     30355 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>
root      1535 16251  0 Jul04 ?        00:00:00              |       \_ [weed] <defunct>

If it does log, where does it log to exactly?

Thanks!