salesforce / sloop

Kubernetes History Visualization
BSD 3-Clause "New" or "Revised" License
1.46k stars 130 forks source link

Failed to list *unstructured.Unstructured: the server could not find the requested resource #158

Open hgliu1985 opened 3 years ago

hgliu1985 commented 3 years ago

When I download the sloop source code and run the command "make linux", then I run the sloop binary with no parameters on my k8s cluster, the error happens:

[root@k8s-master ~]# ./sloop ERROR: logging before flag.Parse: I0604 17:57:03.921818 1446 config.go:253] Default config set I0604 17:57:03.924442 1446 server.go:41] SloopConfig: ConfigFile: "" apiServerHost: "" badgerDiscardRatio: 0.99 badgerEnableEventLogging: false badgerKeepL0InMemory: true badgerLevSizeMultiplier: 0 badgerLevelOneSize: 0 badgerMaxTableSize: 0 badgerNumLevelZeroTables: 0 badgerNumLevelZeroTablesStall: 0 badgerNumOfCompactors: 0 badgerSyncWrites: true badgerUseLSMOnlyOptions: true badgerVLogFileIOMapping: false badgerVLogFileSize: 0 badgerVLogGCFreq: 60000000000 badgerVLogMaxEntries: 200000 badgerVLogTruncate: true bindAddress: "" cleanupFrequency: 1800000000000 context: "" crdRefreshInterval: 300000000000 debugPlaybackFile: "" debugRecordFile: "" defaultKind: _all defaultLookback: 1h defaultNamespace: default deletionBatchSize: 1000 disableKubeWatch: false disableStoreManager: false displayContext: "" enableDeleteKeys: false keepMinorNodeUpdates: false kubeWatchResyncInterval: 1800000000000 leftBarLinks: null maxDiskMb: 32768 maxLookBack: 1209600000000000 mockBadger: false port: 8080 resourceLinks: null restoreDatabaseFile: "" storeRoot: ./data threshold for GC: 0.8 watchCrds: true webfilesPath: ./pkg/sloop/webserver/webfiles I0604 17:57:03.924707 1446 kubeclient.go:20] Getting k8s context with user-defined config masterURL=, kubeContextPreference=. I0604 17:57:03.926010 1446 kubeclient.go:35] Get k8s context with context=kubernetes badger 2021/06/04 17:57:03 INFO: All 1 tables opened in 1ms badger 2021/06/04 17:57:03 INFO: Replaying file id: 0 at offset: 2764788 badger 2021/06/04 17:57:03 INFO: Replay took: 2.726µs badger 2021/06/04 17:57:03 DEBUG: Value log discard stats empty badger 2021/06/04 17:57:03 INFO: badger 2021/06/04 17:57:03 INFO: Level: 0. 0 B Size. 0 B Max. badger 2021/06/04 17:57:03 INFO: Level: 1. 2.7 MB Size. 268 MB Max. badger 2021/06/04 17:57:03 INFO: Level: 2. 0 B Size. 2.7 GB Max. badger 2021/06/04 17:57:03 INFO: Level: 3. 0 B Size. 27 GB Max. badger 2021/06/04 17:57:03 INFO: Level: 4. 0 B Size. 268 GB Max. badger 2021/06/04 17:57:03 INFO: Level: 5. 0 B Size. 2.7 TB Max. badger 2021/06/04 17:57:03 INFO: Level: 6. 0 B Size. 27 TB Max. badger 2021/06/04 17:57:03 INFO: All tables consolidated into one level. Flattening done. I0604 17:57:03.953201 1446 store.go:108] BadgerDB Options: {Dir:data/kubernetes ValueDir:data/kubernetes SyncWrites:true TableLoadingMode:2 ValueLogLoadingMode:2 NumVersionsToKeep:1 ReadOnly:false Truncate:true Logger:0x255f720 Compression:0 EventLogging:true InMemory:false MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:1048576 NumMemtables:5 BlockSize:4096 BloomFalsePositive:0.01 KeepL0InMemory:true MaxCacheSize:0 MaxBfCacheSize:0 LoadBloomsOnOpen:true NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741823 ValueLogMaxEntries:200000 NumCompactors:2 CompactL0OnClose:true LogRotatesToFlush:2 ZSTDCompressionLevel:1 VerifyValueChecksum:false EncryptionKey:[] EncryptionKeyRotationDuration:240h0m0s BypassLockGuard:false ChecksumVerificationMode:0 managedTxns:false maxBatchCount:0 maxBatchSize:0} I0604 17:57:03.953275 1446 kubeclient.go:42] Creating k8sclient with user-defined config masterURL=, kubeContext=kubernetes. I0604 17:57:03.955024 1446 kubeclient.go:57] Created k8sclient with context=kubernetes, masterURL=https://172.26.0.52:6443, configFile=[/root/.kube/config]. I0604 17:57:04.045843 1446 kubewatcher.go:141] Found 15 CRD definitions I0604 17:57:04.046329 1446 kubewatcher.go:152] Stopping 0 CRD Informers I0604 17:57:04.047338 1446 webserver.go:225] Listening on http://localhost:8080 E0604 17:57:04.047618 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource I0604 17:57:04.049055 1446 stats.go:72] Finished updating store stats: &{timestamp:{wall:13845925748516866428 ext:135248307 loc:0x256c200} DiskSizeBytes:5502299 DiskLsmBytes:2712576 DiskLsmFileCount:1 DiskVlogBytes:2789640 DiskVlogFileCount:1 LevelToKeyCount:map[1:1498] LevelToTableCount:map[1:1] TotalKeyCount:1511} I0604 17:57:04.049164 1446 storemanager.go:145] RunValueLogGC(0.99) run took 39.561µs and returned 'Value log GC attempt didn't result in any cleanup' I0604 17:57:04.049080 1446 stats.go:72] Finished updating store stats: &{timestamp:{wall:13845925748516770299 ext:135152178 loc:0x256c200} DiskSizeBytes:5502299 DiskLsmBytes:2712576 DiskLsmFileCount:1 DiskVlogBytes:2789640 DiskVlogFileCount:1 LevelToKeyCount:map[1:1498] LevelToTableCount:map[1:1] TotalKeyCount:1511} E0604 17:57:04.049361 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:04.049418 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource I0604 17:57:04.052559 1446 storemanager.go:203] Deletion/dropPrefix of prefixes took 248ns: I0604 17:57:04.052586 1446 storemanager.go:116] GC finished in 3.395915ms with error ''. Next run in 30m0s E0604 17:57:05.247304 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:05.447439 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:05.647334 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:06.248318 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:06.448430 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:06.648247 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:07.249372 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:07.449493 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource E0604 17:57:07.649390 1446 reflector.go:156] pkg/mod/k8s.io/client-go@v0.17.0/tools/cache/reflector.go:108: Failed to list unstructured.Unstructured: the server could not find the requested resource

The following is some info about my cluster:

[root@k8s-master ~]# kubectl version Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:48:36Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"} [root@k8s-master ~]# uname -a Linux k8s-master 5.2.6-1.el7.elrepo.x86_64 #1 SMP Sun Aug 4 10:13:32 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux [root@k8s-master ~]# cat /etc/system-release CentOS Linux release 7.4.1708 (Core) [root@k8s-master ~]# cat /root/.kube/config apiVersion: v1 clusters:

How to fix this issue? Thanks a lot.

fferraro87 commented 3 years ago

i've same error. do you've fix?