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

More context for syntax not found error #440

Closed
KenxinKun opened this issue Nov 21, 2024 · 13 comments · Fixed by #441
Closed

More context for syntax not found error #440

KenxinKun opened this issue Nov 21, 2024 · 13 comments · Fixed by #441

Comments

@KenxinKun
Copy link

Hi! I'm getting some rather cryptic syntax not found error like below

2024-11-21T10:17:01Z ERR unable to copy file /proto/testdomainservice/v2/service.proto error="proto syntax not found"

As far as I can tell I managed to resolve all the imports, but the error won't give me more information on the specific syntax (i.e. if a message is missing or a proto file can't be imported it's specific about those).

What am I missing? Is there a way to get more context out?

@rez1dent3
Copy link
Member

Hello. Thanks for the valuable comment. By mistake, it can't find syntax. Something like this syntax = "proto3";

@KenxinKun KenxinKun changed the title More contex for syntax not found error More context for syntax not found error Nov 21, 2024
@KenxinKun
Copy link
Author

KenxinKun commented Nov 21, 2024

Hmm that's literally the first line in my proto :)

@rez1dent3
Copy link
Member

No, it crashes on a specific file. It could be a regular expression error. If it's not too much trouble, could you attach the file and write what version of gripmock you're using?

@KenxinKun
Copy link
Author

Sadly the proto is private :/ The version I'm using is Docker's bavix/gripmock:latest

I have tried "cutting out" messages from the file and with a very minimal one it suddenly worked. I could try to narrow it down to a section of the file and see if I can replicate it with a non-private proto.

@KenxinKun
Copy link
Author

Quick update: I think it may have to do with the proto file length: my original file has 2473 lines and after I kept deleting messages, it started passing around ~1000 lines. I will generate some valid but non-sensitive proto to illustrate this and attach it.

@KenxinKun
Copy link
Author

Here it is, steps to reproduce:

  • Download proto from here https://buf.build/kenxinkun/gripmock-test/file/main:generated.proto (let me know if there's access issues, it should be public)
  • cd to the location of generated.proto
  • Run docker run --rm -it -v ./generated.proto:/proto/generated.proto:ro bavix/gripmock /proto/generated.proto
  • This should fail with proto syntax not found
  • Edit the proto file and remove the last message
  • Run the docker command again and this time it should just work

@KenxinKun
Copy link
Author

@rez1dent3 do let me know if you can reproduce my error or if I can help in any way :)

@rez1dent3
Copy link
Member

@KenxinKun Thank you. I'll look at it this weekend or tomorrow.

@rez1dent3
Copy link
Member

The new latest build will be ready in 15 minutes, but I recommend you to switch to 3.x-dev.

The latest build gets into latest, the fix is ​​made only for version 3.x, which is not released yet and I continue to make releases of the second version. Which can affect your pipeline.

docker pull bavix/gripmock:3.x-dev

@KenxinKun
Copy link
Author

Nice! I'll try as soon as I can :)

When do you plan to officially release v3?

@rez1dent3
Copy link
Member

I plan to do it in the first quarter of the 25th year. There is no exact date

@KenxinKun
Copy link
Author

Just dropping a note to confirm the fix works with my real protos now, thanks!

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

Successfully merging a pull request may close this issue.

2 participants