Skip to content

panic when releases.files is NULL #517

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

Closed
jyn514 opened this issue Dec 12, 2019 · 9 comments · Fixed by #519
Closed

panic when releases.files is NULL #517

jyn514 opened this issue Dec 12, 2019 · 9 comments · Fixed by #519
Labels
C-bug Category: This is a bug

Comments

@jyn514
Copy link
Member

jyn514 commented Dec 12, 2019

Caught this from looking through the logs on the build server: https://docs.rs/crate/rips/0.2.0/source/ gives a 500 when you visit it. The build for rips failed, maybe that's why the files are NULL?

Backtrace:

web_1  | thread '<unnamed>' panicked at 'error retrieving column 5: Error(Conversion(WasNull))', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/postgres-0.15.2/src/rows.rs:201:31
web_1  | stack backtrace:
web_1  |   13: postgres::rows::Row::get
web_1  |   14: cratesfyi::web::source::source_browser_handler
web_1  |   15: <F as iron::middleware::Handler>::handle
web_1  |   16: <alloc::boxed::Box<dyn iron::middleware::Handler> as iron::middleware::Handler>::handle
web_1  |   17: router::router::Router::handle_method
web_1  |   18: <router::router::Router as iron::middleware::Handler>::handle
web_1  |   19: iron::middleware::Chain::continue_from_handler
web_1  |   20: <iron::middleware::Chain as iron::middleware::Handler>::handle
web_1  |   21: <alloc::boxed::Box<dyn iron::middleware::Handler> as iron::middleware::Handler>::handle
web_1  |   22: <cratesfyi::web::CratesfyiHandler as iron::middleware::Handler>::handle
web_1  |   23: <iron::iron::RawHandler<H> as hyper::server::Handler>::handle
web_1  |   24: hyper::server::Worker<H>::handle_connection
web_1  |   25: hyper::server::listener::spawn_with::{{closure}}

Note for maintainers: to find other crates with this issue, run this psql command on the server:

SELECT releases.target_name, releases.version FROM releases WHERE releases.files IS NULL;

@jyn514 jyn514 added the C-bug Category: This is a bug label Dec 12, 2019
@jyn514
Copy link
Member Author

jyn514 commented Dec 12, 2019

It looks like this happens whenever the build fails.

@jyn514
Copy link
Member Author

jyn514 commented Dec 12, 2019

@jyn514
Copy link
Member Author

jyn514 commented Dec 12, 2019

Hmm ... I worked around this by returning None in the linked code, which avoids the panic, but the rendered page is still mostly blank :(

mostly-blank_1920x1080

@jyn514
Copy link
Member Author

jyn514 commented Dec 12, 2019

I turned it into a 404 instead, at least we're giving an error message now.

jyn514 added a commit to jyn514/docs.rs that referenced this issue Dec 12, 2019
closes rust-lang#517

gives a 404 if you try to view the source
@jyn514
Copy link
Member Author

jyn514 commented Dec 13, 2019

Reopening because of #521

@jyn514 jyn514 reopened this Dec 13, 2019
@jyn514
Copy link
Member Author

jyn514 commented Dec 15, 2019

While fixing this, I noticed that using the current master branch, binaries do not have their source code saved into the database. However, if I go to e.g. https://docs.rs/crate/bat/0.12.1/source/ all the code is there. Maybe the builder got changed at some point? If so I think it makes more sense to store the code in the DB even for binaries than to special case the error handling if it's not there (see also #520).

cc @pietroalbini , could this have happened during the switch to rustwide?

@jyn514 jyn514 closed this as completed Dec 15, 2019
@jyn514 jyn514 reopened this Dec 15, 2019
@pietroalbini
Copy link
Member

Not sure if I see the point of storing the source code for binaries... people shouldn't look on docs.rs for them.

@jyn514
Copy link
Member Author

jyn514 commented Dec 16, 2019

Ok, in that case I made a PR to fix the panic.

@jyn514
Copy link
Member Author

jyn514 commented Dec 27, 2019

Fixed in #526

@jyn514 jyn514 closed this as completed Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants