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

Demo, fatal repo not found #54

Open
marcellonovak opened this issue Jul 11, 2024 · 6 comments
Open

Demo, fatal repo not found #54

marcellonovak opened this issue Jul 11, 2024 · 6 comments

Comments

@marcellonovak
Copy link

Trying to follow the demo on a fresh ubuntu machine, made it up to here:

intern@intern-vm:~/intern$ export TOPDIR=$(pwd)
intern@intern-vm:~/intern$ git clone https://github.com/veraison/[email protected]
Cloning into '[email protected]'...
remote: Repository not found.
fatal: repository 'https://github.com/veraison/[email protected]/' not found

Repo not found? Are the demo commands out of date?
Thank you for any help.

@setrofim
Copy link
Contributor

setrofim commented Jul 11, 2024

That's a mistake in the docs. git does not support the @ notation for refs (go works that way). The correct syntax would be

git clone --branch demo-cca-1.0.0 https://github.com/veraison/services

@marcellonovak
Copy link
Author

Well I downloaded... something, but now I got this block of errors:

intern@intern-vm:~$ sudo make -C ${TOPDIR}/services
[sudo] password for intern: 
make: Entering directory '/home/intern/services'
make[1]: Entering directory '/home/intern/services/builtin'
/bin/bash: line 1: go: command not found
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/builtin'
make[1]: Entering directory '/home/intern/services/config'
/bin/bash: line 1: go: command not found
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/config'
make[1]: Entering directory '/home/intern/services/handler'
/bin/bash: line 1: go: command not found
protoc --go_out=. --go_opt=paths=source_relative --proto_path=. \
	 --proto_path=../proto \
	--go-grpc_out=. --go-grpc_opt=paths=source_relative \
	--go-json_out=. --go-json_opt=paths=source_relative endorsement_response.proto
google/protobuf/struct.proto: File not found.
google/protobuf/empty.proto: File not found.
evidence.proto:5:1: Import "google/protobuf/struct.proto" was not found or had errors.
evidence.proto:12:9: "google.protobuf.Struct" is not defined.
appraisal_context.proto:7:1: Import "evidence.proto" was not found or had errors.
appraisal_context.proto:10:9: "EvidenceContext" is not defined.
state.proto:6:1: Import "google/protobuf/struct.proto" was not found or had errors.
state.proto: "google.protobuf.ListValue" is not defined.
vts.proto:7:1: Import "google/protobuf/struct.proto" was not found or had errors.
vts.proto:8:1: Import "google/protobuf/empty.proto" was not found or had errors.
vts.proto:9:1: Import "appraisal_context.proto" was not found or had errors.
vts.proto:11:1: Import "state.proto" was not found or had errors.
vts.proto:20:5: "google.protobuf.Struct" is not defined.
vts.proto:44:5: "google.protobuf.Struct" is not defined.
vts.proto:62:25: "google.protobuf.Empty" is not defined.
vts.proto:62:57: "ServiceState" is not defined.
vts.proto:66:51: "AppraisalContext" is not defined.
vts.proto:67:44: "google.protobuf.Empty" is not defined.
endorsement_response.proto:6:1: Import "vts.proto" was not found or had errors.
endorsement_response.proto:9:14: "proto.Endorsement" is not defined.
endorsement_response.proto:10:14: "proto.Endorsement" is not defined.
make[1]: *** [../mk/proto.mk:21: protogen] Error 1
make[1]: Leaving directory '/home/intern/services/handler'
make: *** [mk/subdir.mk:41: handler.all] Error 2
make: Leaving directory '/home/intern/services'

@setrofim
Copy link
Contributor

Hm, it looks like it wants to re-build the GRPC protobuf interfaces (not sure why). You need to install the protobuf compiler and a a few plugins for it:

sudo apt install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/[email protected] && go install google.golang.org/grpc/cmd/[email protected] && go install github.com/mitchellh/protoc-gen-go-json@latest

(the first comand is for Ubuntu and similar; adjust for your distro as appropriate)

@marcellonovak
Copy link
Author

I was able to successfully install protobuf and see the version before, but I tried as you suggested, and got a similar result:

intern@intern-vm:~$ make -C ${TOPDIR}/services
make: Entering directory '/home/intern/services'
make[1]: Entering directory '/home/intern/services/builtin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/builtin'
make[1]: Entering directory '/home/intern/services/config'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/config'
make[1]: Entering directory '/home/intern/services/handler'
protoc --go_out=. --go_opt=paths=source_relative --proto_path=. \
	 --proto_path=../proto \
	--go-grpc_out=. --go-grpc_opt=paths=source_relative \
	--go-json_out=. --go-json_opt=paths=source_relative endorsement_response.proto
google/protobuf/struct.proto: File not found.
google/protobuf/empty.proto: File not found.
evidence.proto:5:1: Import "google/protobuf/struct.proto" was not found or had errors.
evidence.proto:12:9: "google.protobuf.Struct" is not defined.
appraisal_context.proto:7:1: Import "evidence.proto" was not found or had errors.
appraisal_context.proto:10:9: "EvidenceContext" is not defined.
state.proto:6:1: Import "google/protobuf/struct.proto" was not found or had errors.
state.proto: "google.protobuf.ListValue" is not defined.
vts.proto:7:1: Import "google/protobuf/struct.proto" was not found or had errors.
vts.proto:8:1: Import "google/protobuf/empty.proto" was not found or had errors.
vts.proto:9:1: Import "appraisal_context.proto" was not found or had errors.
vts.proto:11:1: Import "state.proto" was not found or had errors.
vts.proto:20:5: "google.protobuf.Struct" is not defined.
vts.proto:44:5: "google.protobuf.Struct" is not defined.
vts.proto:62:25: "google.protobuf.Empty" is not defined.
vts.proto:62:57: "ServiceState" is not defined.
vts.proto:66:51: "AppraisalContext" is not defined.
vts.proto:67:44: "google.protobuf.Empty" is not defined.
endorsement_response.proto:6:1: Import "vts.proto" was not found or had errors.
endorsement_response.proto:9:14: "proto.Endorsement" is not defined.
endorsement_response.proto:10:14: "proto.Endorsement" is not defined.
make[1]: *** [../mk/proto.mk:21: protogen] Error 1
make[1]: Leaving directory '/home/intern/services/handler'
make: *** [mk/subdir.mk:41: handler.all] Error 2
make: Leaving directory '/home/intern/services'

no luck.

@marcellonovak
Copy link
Author

also tried removing the services folder, and re-cloning the repo, with this output:

intern@intern-vm:~$ git clone --branch demo-cca-1.0.0 https://github.com/veraison/services
Cloning into 'services'...
remote: Enumerating objects: 6255, done.
remote: Counting objects: 100% (6254/6254), done.
remote: Compressing objects: 100% (1915/1915), done.
remote: Total 6255 (delta 4268), reused 5854 (delta 4127), pack-reused 1
Receiving objects: 100% (6255/6255), 101.46 MiB | 16.60 MiB/s, done.
Resolving deltas: 100% (4268/4268), done.
Note: switching to 'b6c2b4a90035f47b532c3212a05491a3c9fd4466'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

intern@intern-vm:~$ make -C ${TOPDIR}/services
make: Entering directory '/home/intern/services'
make[1]: Entering directory '/home/intern/services/builtin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/builtin'
make[1]: Entering directory '/home/intern/services/config'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/config'
make[1]: Entering directory '/home/intern/services/handler'
protoc --go_out=. --go_opt=paths=source_relative --proto_path=. \
	 --proto_path=../proto \
	--go-grpc_out=. --go-grpc_opt=paths=source_relative \
	--go-json_out=. --go-json_opt=paths=source_relative endorsement_response.proto
google/protobuf/struct.proto: File not found.
google/protobuf/empty.proto: File not found.
evidence.proto:5:1: Import "google/protobuf/struct.proto" was not found or had errors.
evidence.proto:12:9: "google.protobuf.Struct" is not defined.
appraisal_context.proto:7:1: Import "evidence.proto" was not found or had errors.
appraisal_context.proto:10:9: "EvidenceContext" is not defined.
state.proto:6:1: Import "google/protobuf/struct.proto" was not found or had errors.
state.proto: "google.protobuf.ListValue" is not defined.
vts.proto:7:1: Import "google/protobuf/struct.proto" was not found or had errors.
vts.proto:8:1: Import "google/protobuf/empty.proto" was not found or had errors.
vts.proto:9:1: Import "appraisal_context.proto" was not found or had errors.
vts.proto:11:1: Import "state.proto" was not found or had errors.
vts.proto:20:5: "google.protobuf.Struct" is not defined.
vts.proto:44:5: "google.protobuf.Struct" is not defined.
vts.proto:62:25: "google.protobuf.Empty" is not defined.
vts.proto:62:57: "ServiceState" is not defined.
vts.proto:66:51: "AppraisalContext" is not defined.
vts.proto:67:44: "google.protobuf.Empty" is not defined.
endorsement_response.proto:6:1: Import "vts.proto" was not found or had errors.
endorsement_response.proto:9:14: "proto.Endorsement" is not defined.
endorsement_response.proto:10:14: "proto.Endorsement" is not defined.
make[1]: *** [../mk/proto.mk:21: protogen] Error 1
make[1]: Leaving directory '/home/intern/services/handler'
make: *** [mk/subdir.mk:41: handler.all] Error 2
make: Leaving directory '/home/intern/services'

@setrofim
Copy link
Contributor

setrofim commented Jul 12, 2024

Hm, it looks like protoc is not finding the standard .proto's that should be part of its installation. So either it hasn't installed properly or something is off in the environment. Things to check:

  • Check that struct.proto (one of the things it can't find) exists under /usr/include/google/protobuf. If not, then try re-installing protobuf-compiler (or whatever provides protoc on your distro)
  • Make sure that $(go env GOPATH)/bin (usually resolves to $HOME/go/bin) is still in PATH in the shell you're running the command in (note that if you've updated it inside .bashrc, that won't take effect for shells that are already open).

If this still doesn't work, please provide more info about your environment -- what distro are you on, what version of Go are you using, where/how it was installed, etc

FWIW, the following sequence of commands worked for me inside a fresh Ubuntu 22.04 VM:

sudo apt install git protobuf-compiler
wget https://golang.org/dl/go1.21.6.linux-amd64.tar.gz
tar xvf go1.21.6.linux-amd64.tar.gz -C ~
export PATH=$HOME/go/bin:$PATH
go install google.golang.org/protobuf/cmd/[email protected] && go install google.golang.org/grpc/cmd/[email protected] && go install github.com/mitchellh/protoc-gen-go-json@latest
git clone --branch demo-cca-1.0.0 https://github.com/veraison/services
make -C services/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants