Gangmax Blog

自由之思想,独立之精神

Fix the "google/protobuf/descriptor.proto: file not found" issue

Today when I use “protoc” to compile some protobuf files, I get the “google/protobuf/descriptor.proto: file not found” error.

That means the protobuf files I’m compiling uses this “descriptor.proto” file but cannot find it. I googled this error and here it says that on Debian we can install “libprotobuf-dev” and “libprotoc-dev” packages to fix this issue. However I’m using Mac. This doesn’t work.

Then I found the “descriptor.proto” file can be found in the official “protobuf“ project. After that the fix is easy.

1
git clone https://github.com/protocolbuffers/protobuf.git
2
cd protobuf
3
git checkout v2.5.0

After that, using the following command to compile and the issue is gone:

1
protoc -I ~/code/github/protobuf/src something.proto

Today when I run a Gradle build I get the following error:

1
> gradle clean build       
2
Expiring Daemon because JVM Tenured space is exhausted
3
Daemon will be stopped at the end of the build after running out of JVM memory
4
Expiring Daemon because JVM Tenured space is exhausted
5
Expiring Daemon because JVM Tenured space is exhausted
6
Expiring Daemon because JVM Tenured space is exhausted
7
Expiring Daemon because JVM Tenured space is exhausted
8
Expiring Daemon because JVM Tenured space is exhausted
9
10
> Task :xxx-protobuf-internal-proto-3.1.0:compileJava
11
Note: Some input files use or override a deprecated API.
12
Note: Recompile with -Xlint:deprecation for details.
13
Problem in daemon expiration check
14
java.lang.OutOfMemoryError: GC overhead limit exceeded
15
        at sun.util.resources.LocaleData$LocaleDataResourceBundleControl.toBundleName(LocaleData.java:272)
16
        at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2643)
17
        at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1510)
18
        at java.util.ResourceBundle.findBundle(ResourceBundle.java:1474)
19
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1370)
20
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:899)
21
        at sun.util.resources.LocaleData$1.run(LocaleData.java:167)
22
        at sun.util.resources.LocaleData$1.run(LocaleData.java:163)
23
        at java.security.AccessController.doPrivileged(Native Method)
24
        at sun.util.resources.LocaleData.getBundle(LocaleData.java:163)
25
        at sun.util.resources.LocaleData.getNumberFormatData(LocaleData.java:159)
26
        at sun.util.locale.provider.LocaleResources.getDecimalFormatSymbolsData(LocaleResources.java:168)
27
        at java.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:616)
28
        at java.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:113)
29
        at sun.util.locale.provider.DecimalFormatSymbolsProviderImpl.getInstance(DecimalFormatSymbolsProviderImpl.java:85)
30
        at java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:180)
31
        at java.util.Formatter.getZero(Formatter.java:2283)
32
        at java.util.Formatter.<init>(Formatter.java:1892)
33
        at java.util.Formatter.<init>(Formatter.java:1914)
34
        at java.lang.String.format(String.java:2940)
35
        at org.gradle.launcher.daemon.server.health.DaemonMemoryStatus.exceedsThreshold(DaemonMemoryStatus.java:106)
36
        at org.gradle.launcher.daemon.server.health.DaemonMemoryStatus.isTenuredSpaceExhausted(DaemonMemoryStatus.java:60)
37
        at org.gradle.launcher.daemon.server.health.LowTenuredSpaceDaemonExpirationStrategy.checkExpiration(LowTenuredSpaceDaemonExpirationStrategy.java:39)
38
        at org.gradle.launcher.daemon.server.expiry.AnyDaemonExpirationStrategy.checkExpiration(AnyDaemonExpirationStrategy.java:43)
39
        at org.gradle.launcher.daemon.server.health.HealthExpirationStrategy.checkExpiration(HealthExpirationStrategy.java:38)
40
        at org.gradle.launcher.daemon.server.expiry.AnyDaemonExpirationStrategy.checkExpiration(AnyDaemonExpirationStrategy.java:43)
41
        at org.gradle.launcher.daemon.server.MasterExpirationStrategy.checkExpiration(MasterExpirationStrategy.java:73)
42
        at org.gradle.launcher.daemon.server.Daemon$DaemonExpirationPeriodicCheck.run(Daemon.java:269)
43
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
44
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
45
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
46
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
47
Problem in daemon expiration check
48
java.lang.OutOfMemoryError: GC overhead limit exceeded
49
Failed to execute org.gradle.launcher.daemon.server.Daemon$DaemonExpirationPeriodicCheck@133713d.
50
java.lang.OutOfMemoryError: GC overhead limit exceeded
51
52
> Task :xxx-protobuf-internal-proto-3.7.1:compileJava FAILED
53
54
55
The system is out of resources.
56
Consult the following stack trace for details.
57
java.lang.OutOfMemoryError: GC overhead limit exceeded
58
59
FAILURE: Build failed with an exception.
60
61
* What went wrong:
62
Execution failed for task ':xxx-protobuf-internal-proto-3.7.1:compileJava'.
63
> Compilation failed; see the compiler error output for details.
64
65
* Try:
66
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
67
68
* Get more help at https://help.gradle.org
69
70
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
71
Use '--warning-mode all' to show the individual deprecation warnings.
72
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings
73
74
BUILD FAILED in 10m 54s
75
47 actionable tasks: 47 executed

Here is an answer of how to solve this issue but I don’t try it yet.

Comments