cdbattags / lua-resty-jwt

JWT For The Great Openresty
Apache License 2.0
146 stars 44 forks source link

Error: Rockspec format 3.0 is not supported, please upgrade LuaRocks. #28

Closed Ostico closed 4 years ago

Ostico commented 4 years ago

These are the the os/server/package info. Tell me if you need more info.

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic

# apt-cache policy luarocks
luarocks:
  Installed: 2.4.2+dfsg-1
  Candidate: 2.4.2+dfsg-1
  Version table:
 *** 2.4.2+dfsg-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

# luarocks install lua-resty-jwt
Installing https://luarocks.org/lua-resty-jwt-0.2.2-0.src.rock

Error: Rockspec format 3.0 is not supported, please upgrade LuaRocks.
Ostico commented 4 years ago

I tried with a fallback, this installation works:

luarocks install lua-resty-jwt 0.2.0

but it crashes:

2020/03/19 22:04:08 [warn] 7#7: *10 [lua] _G write guard:12: writing a global lua variable ('crypto') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
    [C]: at 0x7fa096ec3030
    [C]: in function 'require'
    /usr/local/share/lua/5.1/resty/hmac.lua:4: in main chunk
    [C]: in function 'require'
    /usr/local/share/lua/5.1/resty/jwt.lua:5: in main chunk
    [C]: in function 'require'
    ...l/openresty/lualib/lua_scripts/covid19/update_device.lua:3: in main chunk, client: 172.28.0.1, server: _, request: "PUT /device HTTP/1.1", host: "localhost"
2020/03/19 22:04:08 [warn] 7#7: *10 [lua] _G write guard:12: __newindex(): writing a global lua variable ('enc') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
    /usr/local/share/lua/5.1/resty/hmac.lua:9: in main chunk
    [C]: in function 'require'
    /usr/local/share/lua/5.1/resty/jwt.lua:5: in main chunk
    [C]: in function 'require'
    ...l/openresty/lualib/lua_scripts/covid19/update_device.lua:3: in main chunk, client: 172.28.0.1, server: _, request: "PUT /device HTTP/1.1", host: "localhost"
2020/03/19 22:04:09 [error] 7#7: *10 lua entry thread aborted: runtime error: /usr/local/share/lua/5.1/resty/jwt.lua:494: attempt to index field 'ALGOS' (a nil value)
stack traceback:
coroutine 0:
    /usr/local/share/lua/5.1/resty/jwt.lua: in function 'sign'
    ...l/openresty/lualib/lua_scripts/covid19/update_device.lua:33: in main chunk, client: 172.28.0.1, server: _, request: "PUT /device HTTP/1.1", host: "localhost"
Ostico commented 4 years ago

hmac installed by luarocks was in conflict with the one in this package. I removed the luarock package. Now it works đź‘Ť

cdbattags commented 4 years ago

@Ostico sounds like you're all set?

Closing now. If you need anything else please feel free to reach out!

peterDitrih commented 2 years ago

hmac installed by luarocks was in conflict with the one in this package. I removed the luarock package. Now it works +1

hi can u tell me more about the solution to this problem?

what is the hmac package i have to delete?

peterDitrih commented 2 years ago

@Ostico ?

Ostico commented 2 years ago

Hi @peterDitrih

this version

luarocks install lua-resty-jwt 0.2.0

works with

luarocks: 2.4.2+dfsg-1
peterDitrih commented 2 years ago

Hi @peterDitrih

this version

luarocks install lua-resty-jwt 0.2.0

works with

luarocks: 2.4.2+dfsg-1

do you mean you couldn’t setup version 0.2.3?

peterDitrih commented 2 years ago
root@peter-dell:/# luarocks install lua-resty-jwt
Installing https://luarocks.org/lua-resty-jwt-0.2.3-0.src.rock

Error: Rockspec format 3.0 is not supported, please upgrade LuaRocks.

I just have the same problem and i couldn't resolve it (0.2.0 is working, but maybe i could install last version? :) )