-
Notifications
You must be signed in to change notification settings - Fork 13
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
Bad metadata key - Error 16 on Instance Service #38
Comments
Hi I seem to have similar issue. Bad metadata key - error 16. I am using the python example: list_sequencing_positions.py User could call {pos.connect()} here to connect to the running MinKNOW instance.What am I doing wrong? |
Rubru2019, I have been hacking around since I'm getting zilch tech support from ONT, in your minknow folder, edit the app_conf file and set application.rpc.guest_access_default to "enabled". Restart minknow with sudo service minknow restart. This has allowed me to use the port I got back from the flow cell position api and query the Device.get_device_info service successfully |
Thank you! - I will check it. Currently no - access to app_conf... |
Hi @jevansio, I have been working on the issue of connecting to minknow (22.05.5-1~focal) on 9502 (c++). Here I used Best, |
Hi @lutfia95, To connect successfully from C++, you can use this code snippet: // Set up ssl endpoint
std::string const ca = util::read_to_string(".../ca.crt");
grpc::SslCredentialsOptions ssl_ops;
ssl_ops.pem_root_certs = ca;
grpc::ChannelArguments channel_args;
channel_args.SetSslTargetNameOverride("localhost"); // that's what our cert's CN is
auto channel_creds = grpc::SslCredentials(ssl_ops);
// Optionally provide authentication details in channel_creds
channel_creds = grpc::CompositeChannelCredentials(
channel_creds,
grpc::MetadataCredentialsFromPlugin(MyAuthenticationStrategy(...))
);
// Create a channel using the credentials created in the previous step.
auto const channel = grpc::CreateCustomChannel(fmt::format("127.0.0.1:{}", secure_port), channel_creds, channel_args);
You will note several areas you still need to fill in - paths to tokens etc, and the method of authentication. Manager has some api's available without authentication, but most MinKNOW api's require authentication by default. You can read an authentication token from You can supply an authentication token to minknow using this snippet: class MyAuthenticationStrategy : public grpc::MetadataCredentialsPlugin {
public:
MyAuthenticationStrategy(const grpc::string& token) : m_token(token) {}
grpc::Status GetMetadata(
grpc::string_ref service_url, grpc::string_ref method_name,
const grpc::AuthContext& channel_auth_context,
std::multimap<grpc::string, grpc::string>* metadata
) override {
metadata->insert(std::make_pair("local-auth", m_token));
return grpc::Status::OK;
}
private:
grpc::string m_token;
};
After obtaining a token using the methods above. Hope that helps,
|
Hi @lutfia95, I pretty much used exactly the same code as George. Few points to note, When creating the channel, if you connect to "localhost:port" you don't need to override the target name with SetSslTargetNameOverride(localhost). When George talks about disabling authentication on the sequencer, this is what my original post is referring to when I talk about editing the app_conf file in the MinKnow installation folder, if you do this you don't need bother with any of the CompositeChannelCredentials/MyAuthenticationStrategy/auth token code, you simply pass in the SslCredentials object (basically just comment out creating the CompositeChannelCredentials line) Hi @jorj1988, many thanks for supplying the additional piece of the puzzle to add the auth strategy, I had tried adding the token myself manually to the client metadata but that hadnt worked and when I discovered how to disable it the issue obviously vanished Thanks |
Hi @jorj1988 and @jevansio, thank you very much for the nice answers! I am now working on that and will let you know ASAP when I solve the issue.
By installing the MinKNOW UI I used the following command lines from
Is this the correct way to install the MinKNOW UI on Ubuntu Focal? Because ONT developing toward supporting Ubuntu Focal (20.04) and I am not sure if installing it with these commands is the best way to do it. Thanks! |
Hi @lutfia95 , In MinKNOW 5.1, due to changes required for future improvements + features we have changed the way a simulated device is added. Instead of editing the config, you now need to run the minknow service using additional arguments to add simulated devices. You can edit: The below demonstrates adding one simulated minion:
The commands you post look correct for installing minknow for focal. |
@jorj1988 thank you very much, I will check it out. Best, |
Hey @jorj1988, By editing After applying the code snippet, I am getting the error: Thanks! |
|
@jorj1988 Thanks! it solved the problem! As I am planing to use on both OS (Linux and Windows), where can I find the token file You already mentioned that the connection using the token file is for locally connection! How can I adapt also an remote connection to MinKNOW e.g. tool running on different machine where the sequencer is set. Thank you for your support! |
Hi @lutfia95 , If you are connecting to a nanopore sequencer (gridion, promethion, mk1c) you can provision a developer access token using the UI on these boxes, throgh "Host Settings". Right now, for non-nanopore platforms we dont support creating a developer API token. You can enable guest mode on these sequencers in the minknow user config file, by changing The minknow_api/python/minknow_api/manager.py Line 33 in 9ea4a4d
|
Hi, I've successfully connected to the Manager service on 9502 (c++) and supplied the certificate and managed to get basic details and watch the flow cells posistion stream to get updates on the connected flow cells and their ports. But when i come to call an Instance service on one of those ports I get Bad Metadata Key even though Im passing the same certificate. I have tried setting the MINKNOW_API_USE_LOCAL_TOKEN to 1 as per the FAQ and it makes no difference, do i need to restart anything after setting that variable?
Thanks
Jay
The text was updated successfully, but these errors were encountered: