Get an existing public shared variable with the given key, or fail if no such shared variable exists.