Open dhay opened 2 years ago
Hi @dhay - thanks for the report.
I'm unable to reproduce this issue:
$ cargo rover supergraph compose --config ./file.yaml > /dev/null
Finished dev [unoptimized + debuginfo] target(s) in 0.20s
Running `/home/a/work/rover/target/debug/rover supergraph compose --config ./file.yaml`
composing supergraph with Federation v2.0.5.
$ cargo rover supergraph compose --config ./file.yaml --skip-update > /dev/null
Finished dev [unoptimized + debuginfo] target(s) in 0.20s
Running `/home/a/work/rover/target/debug/rover supergraph compose --config ./file.yaml --skip-update`
composing supergraph with Federation v2.0.5.
What is the output of ls ~/.rover/bin
after running the first command?
What is the output of ls ~/.rover/bin after running the first command?
$ ls ~/.rover/bin supergraph-v0.36.1
We're still using Federation 1...perhaps the issue has been fixed in the 2.x plugin? This is the version that
rover
automatically downloaded.
hmmmm, no i don't think that's it. i wish the error message here included what file it was trying to read from. i'll get a PR up to at least get a better error message here and we can try troubleshooting.
for now as a workaround - maybe try running rover install
and see if that fixes up your issue.
Running rover install
didn't seem to help any.
The reason I was thinking it might be a Federation 1 vs. 2 thing is that your output included composing supergraph with Federation v2.0.5.
...or maybe you're using a different version of rover?
nah - rover supergraph compose
works with multiple versions of federation, it downloads the correct version at runtime. here's my output when i don't include any @link
directives in my subgraphs:
$ rover supergraph compose --config ./supergraph.yaml > /dev/null
composing supergraph with Federation v0.36.1.
also - after running rover install
- does rover
appear in ~/.rover/bin
? and can you just call rover
directly without referring to the binary path itself? as in - instead of ./dist/rover
just run rover
since it's in your PATH
?
Weird...if I have ~/.rover/bin
in my path, the error goes away...why should that matter?
so the error you're running into originates from this line which is attempting to run the binary that it found from this function - (src of that function). since you passed --skip-update
, it tries to find your currently installed plugins here and here, and then it even asserts that the file exists here. so... i'm really not sure why it doesn't like it when it's not in your PATH
since we should be handing it a fully qualified path to the binary, and it doesn't error out when it asserts that file exists, only when you actually try to run it.
We ran into this issue today (federation v2) whilst trying to bundle rover & the supergraph plugin in an AWS Lambda layer. Here's a step-by-step to reproduce it on a container running ubuntu, in case anyone's struggling to reproduce the issue:
ROVER_VERSION="v0.9.1"
# Test Setup
mkdir /tmp/composeTest
docker run -it \
-v /tmp/composeTest/:/composeTest/ \
-w /composeTest/ \
-e ROVER_VERSION=$ROVER_VERSION \
ubuntu:latest
apt-get update && apt-get install curl -y
mkdir -p ./rover/
curl --create-dirs -o ./rover/rover -sSL "https://github.com/apollographql/rover/releases/download/${ROVER_VERSION}/rover-${ROVER_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
tar -xvf ./rover/rover -C ./rover/
export PATH=$PATH:/composeTest/rover/dist
# Schema
mkdir ./files
cat > ./files/test.gql <<- EOM
type Query {
lookup(foo: String!): LookupResult!
}
type LookupResult {
name: String!
}
EOM
cat > ./files/supergraph.yml <<- EOM
federation_version: 2
subgraphs:
test:
routing_url: https://not-a-url.com/
schema:
file: /composeTest/files/test.gql
EOM
# Execute
rover supergraph compose --elv2-license accept --config /composeTest/files/supergraph.yml
# ...composing supergraph with Federation v2.1.2...
# Succeeds. Downloads plugin to /root/.rover/bin/supergraph-v2.1.2
# Execute with --skip-update set
rover supergraph compose --skip-update --elv2-license accept --config /composeTest/files/supergraph.yml
# ...composing supergraph with Federation v2.1.2...
# error: Failed to execute command
#
# Caused by:
# No such file or directory (os error 2)
Updating $PATH
with the plugin location described above seems to fix it, as does storing the supergraph plugin alongside rover in the same directory.
Description
When attempting to compose a supergraph, if add the
--skip-update
flag, the composition fails. It works correctly when the flag is omitted:Steps to reproduce
Expected result
Passing the
--skip-update
shouldn't have any bearing on whether the composition succeeds or fails.Actual result
Received the error:
Environment
$ ./rover-apple-darwin/dist/rover info Rover Info: Version: 0.8.1 Install Location: /home/me/rover-apple-darwin/dist/rover OS: Mac OS 12.4.0 [64-bit] Shell: /usr/local/bin/bash