veracruz icon indicating copy to clipboard operation
veracruz copied to clipboard

Requesting a nonexistent file generates a `Length prefix missing` error on Veracruz-Client

Open gbryant-arm opened this issue 2 years ago • 3 comments

Describe the bug Requesting a nonexistent file generates a Length prefix missing error on Veracruz-Client. This is because read_file_by_absolute_path() fails in read_file(), which ultimately results in the RM failing to send TLS data and sending an empty HTTP response. @egrimley-arm 's current work on removing HTTP between VC-Client and RM might have an impact on that.

To Reproduce Request a file that doesn't exist:

<client> --result /nonexisting_file=- --identity <...> --key <...>

Expected behaviour The runtime manager should always prefix the messages it sends with the protocol buffer's length.

gbryant-arm avatar Nov 11 '22 19:11 gbryant-arm

I'm not sure that the person or program that invokes vc-client needs to know about the details of whether protocol buffers are prefixed with lengths. The main thing is that vc-client writes nothing to stdout and exits with a non-zero status code, right? It might be doing that correctly after #552 is merged, but we should check.

egrimley-arm avatar Nov 11 '22 20:11 egrimley-arm

I agree that the protocol buffer handling should be transparent to the invoker. Just saying a FS-related error shouldn't propagate to the TLS layer. Additionally, for security reasons, we should try to minimise the number of errors the RM can return. Sure, let's wait for #552 to be merged :+1:

gbryant-arm avatar Nov 14 '22 10:11 gbryant-arm

PR #584 might deal with this.

egrimley-arm avatar Dec 20 '22 16:12 egrimley-arm