-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Error fetching crate #153
Comments
I am observing the same behavior on Arch Linux. Could the recent curl update be the reason? |
What curl version are you using? |
$ curl --version
curl 8.12.1 (x86_64-pc-linux-gnu) libcurl/8.12.1 OpenSSL/3.4.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.64.0 nghttp3/1.7.0
Release-Date: 2025-02-13
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd |
Same error started appearing here. This morning everything was working, since lunch break (about 2 hours ago), it stopped working.
Can I somehow enable logging, to better diagnose this? |
I am getting the same errors on arch linux |
@saecki: It's failing to parse the crates.nvim/lua/crates/api.lua Lines 411 to 412 in 1c924d5
and further down here as well: crates.nvim/lua/crates/api.lua Line 445 in 1c924d5
They must've changed the format, somehow. This is the format I receive from, for example,
The regex fails to recognize the |
Now that @Leandros found where the issue occurs, I was able to 'fix' it as follows: I edited -- local pat = "^([0-9][0-9][0-9][0-9])%-([0-9][0-9])%-([0-9][0-9])" -- date
-- .. "T([0-9][0-9]):([0-9][0-9]):([0-9][0-9])%.[0-9]+" -- time
-- .. "([%+%-])([0-9][0-9]):([0-9][0-9])$" -- offset
-- local year, month, day, hour, minute, second, offset, offset_hour, offset_minute = str:match(pat)
local pat = "^([0-9][0-9][0-9][0-9])%-([0-9][0-9])%-([0-9][0-9])" -- date
.. "T([0-9][0-9]):([0-9][0-9]):([0-9][0-9])%.[0-9]+Z$" -- time
local year, month, day, hour, minute, second = str:match(pat)
local offset = 0
local offset_hour = 0
local offset_minute = 0 This seems to fix it for me. |
Quick and dirty patch for everyone that fixes the issue: diff --git a/lua/crates/time.lua b/lua/crates/time.lua
index 40c7919..c69b4c0 100644
--- a/lua/crates/time.lua
+++ b/lua/crates/time.lua
@@ -17,7 +17,7 @@ function DateTime.parse_rfc_3339(str)
-- lua regex suports no {n} occurences
local pat = "^([0-9][0-9][0-9][0-9])%-([0-9][0-9])%-([0-9][0-9])" -- date
.. "T([0-9][0-9]):([0-9][0-9]):([0-9][0-9])%.[0-9]+" -- time
- .. "([%+%-])([0-9][0-9]):([0-9][0-9])$" -- offset
+ .. "([%+%-Z])([0-9]?[0-9]?):?([0-9]?[0-9]?)$" -- offset
local year, month, day, hour, minute, second, offset, offset_hour, offset_minute = str:match(pat)
if year then
@@ -29,6 +29,9 @@ function DateTime.parse_rfc_3339(str)
elseif offset == "-" then
h = tonumber(hour) - tonumber(offset_hour)
m = tonumber(minute) - tonumber(offset_minute)
+ elseif offset == 'Z' then
+ h = tonumber(hour)
+ m = tonumber(minute)
end
return DateTime.new(os.time({
---@diagnostic disable-next-line: assign-type-mismatch This makes sure that the dates are still available properly. |
PR with fix: #154 |
I've merged the PR for parsing an explicit UTC offset, does that fix the issue here? |
getting the same on fedora 41 👍 |
fixed for me @saecki 👍 |
Important
This issue has been fixed, update to the latest stable version
Description
Hi, not sure what's going on, but today when I wanted to bump some of my dependencies I got this:
Not so long ago (last week?) I did not have any issues...
Neovim version
NVIM v0.11.0-dev-4a2a54f
Health check
Checking plugins ~ - null-ls.nvim not found - neoconf.nvim not found - OK nvim-cmp installed - coq_nvim not found Checking external dependencies ~ - OK curl installed
Operating system and version
Arch Linux
Expected behavior
I expect at least some versions to resolve.
Actual behavior
maybe the api is down? Then again, I manually checked
https://crates.io/api/v1/crates/bevy
for example and that seemed to workMinimal config
Cargo.toml
[package]
name = "my_package"
version = "0.0.0"
edition = "2021"
[features]
default = ["fast-compile"]
fast-compile = ["bevy/dynamic_linking"]
dark-mode = []
[dependencies]
anyhow = "1.0.93"
bevy = { version = "0.14.2" }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
reqwest = {version="0.12.9", features=["blocking"]}
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4.45"
js-sys = "0.3.72"
[profile.dev]
opt-level = 1
overflow-checks = false
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
[profile.wasm-release]
inherits = "release"
opt-level = "s"
strip = "debuginfo"
Steps to reproduce
nvim --clean -u minimal.lua
The text was updated successfully, but these errors were encountered: