crawlab-team / crawlab

Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台,支持任何语言和框架
https://www.crawlab.cn
BSD 3-Clause "New" or "Revised" License
11.38k stars 1.8k forks source link

invalid character '-' in numeric literal #1012

Closed aaronflorey closed 1 year ago

aaronflorey commented 3 years ago

Describe the bug I've tried this in docker running :develop and :latest, but i get invalid character '-' in numeric literal when trying to upload a Scrapy project using the SDK CLI. I've tried many different combinations to get it to work, even submitting a ZIP with a single empty py file in it.

To Reproduce Steps to reproduce the behavior:

  1. Run crawlab upload
  2. upload fails with invalid character '-' in numeric literal
  3. see below logs in console

Expected behavior

Logs

crawlab_master    | invalid character '-' in numeric literal
crawlab_master    | /go/pkg/mod/github.com/crawlab-team/go-trace@v0.1.0/trace.go:11 github.com/crawlab-team/go-trace.TraceError()
crawlab_master    | /go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.0-beta.20210811.1634/controllers/utils_http.go:12 github.com/crawlab-team/crawlab-core/controllers.HandleError()
crawlab_master    | /go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.0-beta.20210811.1634/controllers/utils_http.go:21 github.com/crawlab-team/crawlab-core/controllers.HandleErrorBadRequest()
crawlab_master    | /go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.0-beta.20210811.1634/controllers/delegate_list.go:66 github.com/crawlab-team/crawlab-core/controllers.(*ListControllerDelegate).PostList()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161 github.com/gin-gonic/gin.(*Context).Next()
crawlab_master    | /go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.0-beta.20210811.1634/middlewares/auth.go:29 github.com/crawlab-team/crawlab-core/middlewares.AuthorizationMiddleware.func1()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161 github.com/gin-gonic/gin.(*Context).Next()
crawlab_master    | /go/pkg/mod/github.com/crawlab-team/crawlab-core@v0.6.0-beta.20210811.1634/middlewares/cors.go:17 github.com/crawlab-team/crawlab-core/middlewares.CORSMiddleware.func1()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161 github.com/gin-gonic/gin.(*Context).Next()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/recovery.go:83 github.com/gin-gonic/gin.RecoveryWithWriter.func1()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161 github.com/gin-gonic/gin.(*Context).Next()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/logger.go:241 github.com/gin-gonic/gin.LoggerWithConfig.func1()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/context.go:161 github.com/gin-gonic/gin.(*Context).Next()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/gin.go:409 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()
crawlab_master    | /go/pkg/mod/github.com/gin-gonic/gin@v1.6.3/gin.go:367 github.com/gin-gonic/gin.(*Engine).ServeHTTP()
crawlab_master    | /usr/local/go/src/net/http/server.go:2843 net/http.serverHandler.ServeHTTP()
crawlab_master    | /usr/local/go/src/net/http/server.go:1925 net/http.(*conn).serve()
crawlab_master    | /usr/local/go/src/runtime/asm_amd64.s:1374 runtime.goexit()
tikazyq commented 3 years ago

I think this is probably because you used the old version of CLI (0.3.3). You should use the latest version of CLI for 0.6.0-beta.

pip install crawlab-sdk==0.6.b20210729-1634

aaronflorey commented 3 years ago

Hey @tikazyq

Thanks for the reply. That version doesn't work for me at all, it seems there is no cli module in there anymore? It's under legacy which doesn't work

tikazyq commented 2 years ago

Use the latest version pip install crawlab-sdk==0.6.b20211224-1500

tikazyq commented 2 years ago

You can also refer to the CLI tools documentation