Skip to content
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

rgw/lua: add more info on package install errors #51415

Merged
merged 1 commit into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rgw/rgw_appmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void rgw::AppMain::init_lua()
r = rgw::lua::install_packages(dpp, driver, null_yield, path,
failed_packages, output);
if (r < 0) {
dout(1) << "WARNING: failed to install lua packages from allowlist"
dout(1) << "WARNING: failed to install lua packages from allowlist. error: " << r
<< dendl;
}
if (!output.empty()) {
Expand Down
4 changes: 3 additions & 1 deletion src/rgw/rgw_lua.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Driver* driver,
if (std::filesystem::remove_all(luarocks_path, ec)
== static_cast<std::uintmax_t>(-1) &&
ec != std::errc::no_such_file_or_directory) {
output.append("failed to clear luarock directory: ");
output.append("failed to clear luarocks directory: ");
output.append(ec.message());
output.append("\n");
return ec.value();
Expand All @@ -175,11 +175,13 @@ int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Driver* driver,
return 0;
}
if (ret < 0) {
output.append("failed to get lua package list");
return ret;
}
// verify that luarocks exists
const auto p = bp::search_path("luarocks");
if (p.empty()) {
output.append("failed to find luarocks");
return -ECHILD;
}

Expand Down