[GH-ISSUE #849] protobuf .proto added Successfully , unable to resolve message type... #843

Open
opened 2026-03-03 19:22:20 +03:00 by kerem · 11 comments
Owner

Originally created by @Tawenxd on GitHub (Apr 6, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/849

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version? (Ex. Proxyman 1.4.3)

macOS Version? (Ex. mac 10.14)

Steps to reproduce

Expected behavior

Screenshots (optional)

image

Originally created by @Tawenxd on GitHub (Apr 6, 2021). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/849 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version? (Ex. Proxyman 1.4.3) ### macOS Version? (Ex. mac 10.14) ### Steps to reproduce ### Expected behavior ### Screenshots (optional) ![image](https://user-images.githubusercontent.com/19664829/113712209-6dad1100-9718-11eb-9390-5313e0333c5e.png)
Author
Owner

@NghiaTranUIT commented on GitHub (Apr 6, 2021):

@Tawenxd can you share with me the name of your message in the proto file?

Maybe there is a message that Proxyman hasn't supported yet.

and what proto version are you using? 🤔

<!-- gh-comment-id:814096792 --> @NghiaTranUIT commented on GitHub (Apr 6, 2021): @Tawenxd can you share with me the name of your message in the proto file? Maybe there is a message that Proxyman hasn't supported yet. and what proto version are you using? 🤔
Author
Owner

@Tawenxd commented on GitHub (Apr 6, 2021):

@NghiaTranUIT proto 3

<!-- gh-comment-id:814123293 --> @Tawenxd commented on GitHub (Apr 6, 2021): @NghiaTranUIT proto 3
Author
Owner

@florentmorin commented on GitHub (Oct 24, 2021):

Same problem here.

My sample code

category.proto

package com.example;

syntax = "proto3";

enum Category {
  WORK = 0;
  HOME = 1;
  FAMILY = 2;
}

task.proto

package com.example;

syntax = "proto3";

import "category.proto";
import "google/protobuf/timestamp.proto";

message Task {
  string title = 1;
  Category category = 2;
  Timestamp date = 3;
  bool done = 4;
}

tasksresponse.proto

package com.example;

syntax = "proto3";

import "task.proto";

message TasksResponse {
  repeated Task tasks = 1;
}

<!-- gh-comment-id:950370488 --> @florentmorin commented on GitHub (Oct 24, 2021): Same problem here. ### My sample code `category.proto` ```protobuf package com.example; syntax = "proto3"; enum Category { WORK = 0; HOME = 1; FAMILY = 2; } ``` `task.proto` ```protobuf package com.example; syntax = "proto3"; import "category.proto"; import "google/protobuf/timestamp.proto"; message Task { string title = 1; Category category = 2; Timestamp date = 3; bool done = 4; } ``` `tasksresponse.proto` ```protobuf package com.example; syntax = "proto3"; import "task.proto"; message TasksResponse { repeated Task tasks = 1; } ```
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 25, 2021):

Thanks for the file @florentmorin I will check out this week 👍

<!-- gh-comment-id:950993550 --> @NghiaTranUIT commented on GitHub (Oct 25, 2021): Thanks for the file @florentmorin I will check out this week 👍
Author
Owner

@basic1aw commented on GitHub (Nov 15, 2021):

I just encountered the same problem, any interim solution or update here

<!-- gh-comment-id:968735431 --> @basic1aw commented on GitHub (Nov 15, 2021): I just encountered the same problem, any interim solution or update here
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 17, 2021):

@florentmorin I found there are multiple issues from your proto files:

When adding the task.proto, Proxyman prints this log (Sorry that Proxyman didn't display any error alert)

[ProtobufRawImporter] ⚠️ ERROR: File not found.
[ProtobufRawImporter] ⚠️ ERROR: File not found.
[ProtobufRawImporter] ⚠️ ERROR: Import "category.proto" was not found or had errors.
[ProtobufRawImporter] ⚠️ ERROR: Import "google/protobuf/timestamp.proto" was not found or had errors.
[ProtobufRawImporter] ⚠️ ERROR: "Category" is not defined.
[ProtobufRawImporter] ⚠️ ERROR: "Timestamp" is not defined.

Here is the correct version:

  • category.proto
syntax = "proto3";

package com.example;

enum Category {
  WORK = 0;
  HOME = 1;
  FAMILY = 2;
}
  • task.proto
syntax = "proto3";

package com.example;

import "category.proto";
import "google.common.proto";

message Task {
  string title = 1;
  Category category = 2;
  google.protobuf.Timestamp date = 3;
  bool done = 4;
}
  • taskresponse.proto
syntax = "proto3";

package com.example;

import "task.proto";

message TasksResponse {
  repeated Task tasks = 1;
}

The difference from your original proto files:

  1. The syntax = "proto3"; must be located on the top of the file
  2. Use google.protobuf.Timestamp instead of Timestamp
  3. Use import "google.common.proto";
  4. Must import the category.proto -> task.proto -> taskresponse.proto (It's a bug from Proxyman)

Then Proxyman can capture and parse it properly.

Screen Shot 2021-11-17 at 11 41 02

Conclusion

I agree that it's a huge challenge issue from Proxyman 😿

I suppose that I should display the error and instruct the user to generate a proper proto file.

<!-- gh-comment-id:971176920 --> @NghiaTranUIT commented on GitHub (Nov 17, 2021): @florentmorin I found there are multiple issues from your proto files: When adding the `task.proto`, Proxyman prints this log (Sorry that Proxyman didn't display any error alert) ``` [ProtobufRawImporter] ⚠️ ERROR: File not found. [ProtobufRawImporter] ⚠️ ERROR: File not found. [ProtobufRawImporter] ⚠️ ERROR: Import "category.proto" was not found or had errors. [ProtobufRawImporter] ⚠️ ERROR: Import "google/protobuf/timestamp.proto" was not found or had errors. [ProtobufRawImporter] ⚠️ ERROR: "Category" is not defined. [ProtobufRawImporter] ⚠️ ERROR: "Timestamp" is not defined. ``` Here is the correct version: - `category.proto` ```proto syntax = "proto3"; package com.example; enum Category { WORK = 0; HOME = 1; FAMILY = 2; } ``` - `task.proto` ```proto syntax = "proto3"; package com.example; import "category.proto"; import "google.common.proto"; message Task { string title = 1; Category category = 2; google.protobuf.Timestamp date = 3; bool done = 4; } ``` - `taskresponse.proto` ```proto syntax = "proto3"; package com.example; import "task.proto"; message TasksResponse { repeated Task tasks = 1; } ``` ### The difference from your original proto files: 1. The `syntax = "proto3";` must be located on the top of the file 2. Use `google.protobuf.Timestamp` instead of `Timestamp` 3. Use `import "google.common.proto";` 4. Must import the `category.proto` -> `task.proto` -> `taskresponse.proto` (It's a bug from Proxyman) Then Proxyman can capture and parse it properly. <img width="1597" alt="Screen Shot 2021-11-17 at 11 41 02" src="https://user-images.githubusercontent.com/5878421/142135998-6799c64e-3396-45b8-993e-4d0aaba0c739.png"> ### Conclusion I agree that it's a huge challenge issue from Proxyman 😿 I suppose that I should display the error and instruct the user to generate a proper proto file.
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 17, 2021):

To fix it, I will write an auto-correction when you guys import the protobuf file. It will automatically fix it 👍

<!-- gh-comment-id:971278223 --> @NghiaTranUIT commented on GitHub (Nov 17, 2021): To fix it, I will write an auto-correction when you guys import the protobuf file. It will automatically fix it 👍
Author
Owner

@florentmorin commented on GitHub (Nov 17, 2021):

My bad. Thank you! 🙏

<!-- gh-comment-id:971301356 --> @florentmorin commented on GitHub (Nov 17, 2021): My bad. Thank you! 🙏
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 17, 2021):

it's not your fault @florentmorin. Just wondering: Are your proto files automatically generated? If yes, which tool is it? 🤔

<!-- gh-comment-id:971302857 --> @NghiaTranUIT commented on GitHub (Nov 17, 2021): it's not your fault @florentmorin. Just wondering: Are your proto files automatically generated? If yes, which tool is it? 🤔
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 20, 2021):

Hey @florentmorin @basic1aw and @Tawenxd, if you don't mind, please try this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.35.0_Fix_protobuf_issue.dmg

Proxyman now can automatically fix the issue on your imported Proto file 👍

However, you have to import in the correct order of dependency (Take a look at this example: https://github.com/ProxymanApp/Proxyman/issues/849#issuecomment-971176920)

Additionally, it will display the error when importing the file.

Screen Shot 2021-11-20 at 19 50 01
<!-- gh-comment-id:974645848 --> @NghiaTranUIT commented on GitHub (Nov 20, 2021): Hey @florentmorin @basic1aw and @Tawenxd, if you don't mind, please try this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.35.0_Fix_protobuf_issue.dmg Proxyman now can automatically fix the issue on your imported Proto file 👍 However, you have to import in the correct order of dependency (Take a look at this example: https://github.com/ProxymanApp/Proxyman/issues/849#issuecomment-971176920) Additionally, it will display the error when importing the file. <img width="812" alt="Screen Shot 2021-11-20 at 19 50 01" src="https://user-images.githubusercontent.com/5878421/142726891-eec85d88-3a7a-41a6-bd30-9253337f82f4.png">
Author
Owner

@florentmorin commented on GitHub (Nov 27, 2021):

@NghiaTranUIT Sorry, but I have a problem with timestamp import.

With this syntax, it works with Node / Swift, but don't work with Proxyman:

import "google/protobuf/timestamp.proto";

While it's the opposite with:

import "google.common.proto";
<!-- gh-comment-id:980531126 --> @florentmorin commented on GitHub (Nov 27, 2021): @NghiaTranUIT Sorry, but I have a problem with timestamp import. With this syntax, it works with Node / Swift, but don't work with Proxyman: ```protobuf import "google/protobuf/timestamp.proto"; ``` While it's the opposite with: ```protobuf import "google.common.proto"; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#843
No description provided.