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

grobid run giving '/tini: 1: Syntax error: "(" unexpected' #1229

Open
AaronNGray opened this issue Jan 13, 2025 · 8 comments
Open

grobid run giving '/tini: 1: Syntax error: "(" unexpected' #1229

AaronNGray opened this issue Jan 13, 2025 · 8 comments

Comments

@AaronNGray
Copy link

Operating System and architecture (arm64, amd64, x86, etc.)

arm64

What is your Java version

default docker version

Log and information

sudo docker build -t grobid/grobid:0.8.2-SNAPSHOT --build-arg GROBID_VERSION=0.8.2-SNAPSHOT --file Dockerfile.crf .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  1.659GB
Step 1/40 : FROM openjdk:17-jdk-slim as builder
 ---> 8a3a2ffec52a
Step 2/40 : USER root
 ---> Using cache
 ---> bf5e5f8f3927
Step 3/40 : RUN apt-get update &&     apt-get -y upgrade &&     apt-get -y --no-install-recommends install unzip
 ---> Using cache
 ---> 4bcd83e734e9
Step 4/40 : WORKDIR /opt/grobid-source
 ---> Using cache
 ---> 748c902be43a
Step 5/40 : COPY gradle/ ./gradle/
 ---> Using cache
 ---> 16d214770581
Step 6/40 : COPY gradlew ./
 ---> Using cache
 ---> 6c4d375df648
Step 7/40 : COPY gradle.properties ./
 ---> Using cache
 ---> f220223c1799
Step 8/40 : COPY build.gradle ./
 ---> Using cache
 ---> beed9567a5f3
Step 9/40 : COPY settings.gradle ./
 ---> Using cache
 ---> 08db6f5d2c7e
Step 10/40 : COPY grobid-home/ ./grobid-home/
 ---> Using cache
 ---> bed72f63793b
Step 11/40 : COPY grobid-core/ ./grobid-core/
 ---> Using cache
 ---> 6feba1084ede
Step 12/40 : COPY grobid-service/ ./grobid-service/
 ---> Using cache
 ---> 27360be88408
Step 13/40 : COPY grobid-trainer/ ./grobid-trainer/
 ---> Using cache
 ---> 5646305d2929
Step 14/40 : RUN rm -rf grobid-home/pdf2xml
 ---> Using cache
 ---> d41a35fa44ad
Step 15/40 : RUN rm -rf grobid-home/pdfalto/lin-32
 ---> Using cache
 ---> af81311d03c3
Step 16/40 : RUN rm -rf grobid-home/pdfalto/mac-64
 ---> Using cache
 ---> ed072516bb51
Step 17/40 : RUN rm -rf grobid-home/pdfalto/mac_arm-64
 ---> Using cache
 ---> e45eaf1f85af
Step 18/40 : RUN rm -rf grobid-home/pdfalto/win-*
 ---> Using cache
 ---> 9075d2d8f77b
Step 19/40 : RUN rm -rf grobid-home/lib/lin-32
 ---> Using cache
 ---> f3c32dc4aebf
Step 20/40 : RUN rm -rf grobid-home/lib/win-*
 ---> Using cache
 ---> e18fa0edcc11
Step 21/40 : RUN rm -rf grobid-home/lib/mac-64
 ---> Using cache
 ---> 00f1641da9cc
Step 22/40 : RUN rm -rf grobid-home/models/*-BidLSTM_CRF*
 ---> Using cache
 ---> c4cb2d8e80fd
Step 23/40 : ENV GROBID_SERVICE_OPTS "-Djava.library.path=grobid-home/lib/lin-64:grobid-home/lib/lin-64/jep"
 ---> Using cache
 ---> cac00437cab3
Step 24/40 : RUN ./gradlew clean assemble --no-daemon  --info --stacktrace
 ---> Using cache
 ---> 5238dc3362aa
Step 25/40 : WORKDIR /opt/grobid
 ---> Using cache
 ---> b9b0dcc7cb20
Step 26/40 : RUN unzip -o /opt/grobid-source/grobid-service/build/distributions/grobid-service-*.zip &&     mv grobid-service* grobid-service
 ---> Using cache
 ---> 3f960ef0b01c
Step 27/40 : RUN unzip -o /opt/grobid-source/grobid-home/build/distributions/grobid-home-*.zip &&     chmod -R 755 /opt/grobid/grobid-home/pdfalto
 ---> Using cache
 ---> 8fc1f954235e
Step 28/40 : RUN rm -rf grobid-source
 ---> Using cache
 ---> 89bcb21e2d19
Step 29/40 : FROM openjdk:17-slim
 ---> 8a3a2ffec52a
Step 30/40 : RUN apt-get update &&     apt-get -y upgrade &&     apt-get -y --no-install-recommends install libxml2 libfontconfig &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 0ca0d18894e8
Step 31/40 : ENV TINI_VERSION v0.19.0
 ---> Using cache
 ---> 678aee43b571
Step 32/40 : ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
Downloading [==================================================>]  24.06kB/24.06kB

 ---> Using cache
 ---> 134483ed0b99
Step 33/40 : RUN chmod +x /tini
 ---> Using cache
 ---> e0b9ef35f733
Step 34/40 : ENTRYPOINT ["/tini", "-s", "--"]
 ---> Using cache
 ---> 8f170aa031c3
Step 35/40 : WORKDIR /opt/grobid
 ---> Using cache
 ---> 69f8b1896d2a
Step 36/40 : COPY --from=builder /opt/grobid .
 ---> Using cache
 ---> 0470f995ec26
Step 37/40 : ENV GROBID_SERVICE_OPTS "-Djava.library.path=grobid-home/lib/lin-64:grobid-home/lib/lin-64/jep --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED"
 ---> Using cache
 ---> dbaa10d2d6a8
Step 38/40 : CMD ["./grobid-service/bin/grobid-service"]
 ---> Using cache
 ---> c31e22f293f3
Step 39/40 : ARG GROBID_VERSION
 ---> Using cache
 ---> 0825633972f9
Step 40/40 : LABEL     authors="The contributors"     org.label-schema.name="GROBID"     org.label-schema.description="Image with GROBID service"     org.label-schema.url="https://github.com/kermitt2/grobid"     org.label-schema.version=${GROBID_VERSION}
 ---> Running in 2e76682a68c7
Removing intermediate container 2e76682a68c7
 ---> 7e277409f530
Successfully built 7e277409f530
Successfully tagged grobid/grobid:0.8.2-SNAPSHOT
sudo docker run --rm --init --ulimit core=0 -p 8080:8070 -p 8081:8071 grobid/grobid:0.8.2-SNAPSHOT
/tini: 1: Syntax error: "(" unexpected

Further information

No response

@AaronNGray
Copy link
Author

getting same with 0.8.1

@AaronNGray
Copy link
Author

https://github.com/kermitt2/grobid/blob/ed420e4aa40608e0eaf96585a981fab51483d435/Dockerfile.crf#L75C5-L75C75

Looks like I need the ARM64 version !

Will fork, fix, and hopefully do pull request all being well.

@lfoppiano
Copy link
Collaborator

lfoppiano commented Jan 13, 2025

Thanks @AaronNGray. There is a PR that is WIP still but can give you a head start #1165.

I got the multi architecture build to work but there are some issues with the way processes are forked, which I could not finish solving.

@AaronNGray
Copy link
Author

testing ...

@AaronNGray
Copy link
Author

AaronNGray commented Jan 13, 2025

@lfoppiano I am still getting the issue with the multi-arch-docker-image branch

I suggest trying

-${TARGETARCH}

Just trying :-

https://github.com/AaronNGray/grobid/blob/24bf96ed79b56dc0f3e63015e162131478d21a41/Dockerfile.crf#L75

@AaronNGray
Copy link
Author

ended up just hacking it with -arm64
Now getting the following :-

sudo docker run --rm --init --ulimit core=0 -p 8080:8070 -p 8081:8071 aaronngray/grobid:0.8.2-SNAPSHOT
WARN  [2025-01-14 01:16:34,221] org.hibernate.validator.internal.properties.javabean.JavaBeanExecutable: HV000254: Missing parameter metadata for ResponseMeteredLevel(String, int), which declares implicit or synthetic parameters. Automatic resolution of generic type information for method parameters may yield incorrect results if multiple parameters have the same erasure. To solve this, compile your code with the '-parameters' flag.
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) [Guice/ErrorInjectingConstructor]: UnsatisfiedLinkError: /opt/grobid/grobid-home/lib/lin-64/libwapiti.so: /opt/grobid/grobid-home/lib/lin-64/libwapiti.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)
  at GrobidRestService.<init>(GrobidRestService.java:73)
  at GrobidServiceModule.configure(GrobidServiceModule.java:33)
      \_ installed by: Elements$ElementsAsModule -> GrobidServiceModule
  while locating GrobidRestService

Learn more:
  https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR

1 error

======================
Full classname legend:
======================
Elements$ElementsAsModule: "com.google.inject.spi.Elements$ElementsAsModule"
GrobidRestService:         "org.grobid.service.GrobidRestService"
GrobidServiceModule:       "org.grobid.service.modules.GrobidServiceModule"
========================
End of classname legend:
========================

	at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:589)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:190)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:113)
	at com.google.inject.Guice.createInjector(Guice.java:87)
	at ru.vyarus.dropwizard.guice.injector.DefaultInjectorFactory.createInjector(DefaultInjectorFactory.java:20)
	at ru.vyarus.dropwizard.guice.module.GuiceyRunner.createInjector(GuiceyRunner.java:109)
	at ru.vyarus.dropwizard.guice.GuiceBundle.run(GuiceBundle.java:140)
	at ru.vyarus.dropwizard.guice.GuiceBundle.run(GuiceBundle.java:101)
	at io.dropwizard.core.setup.Bootstrap.run(Bootstrap.java:199)
	at io.dropwizard.core.cli.EnvironmentCommand.run(EnvironmentCommand.java:65)
	at io.dropwizard.core.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
	at io.dropwizard.core.cli.Cli.run(Cli.java:78)
	at io.dropwizard.core.Application.run(Application.java:94)
	at org.grobid.service.main.GrobidServiceApplication.main(GrobidServiceApplication.java:120)
Caused by: java.lang.UnsatisfiedLinkError: /opt/grobid/grobid-home/lib/lin-64/libwapiti.so: /opt/grobid/grobid-home/lib/lin-64/libwapiti.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
	at java.base/java.lang.Runtime.load0(Unknown Source)
	at java.base/java.lang.System.load(Unknown Source)
	at org.grobid.core.main.LibraryLoader.load(LibraryLoader.java:122)
	at org.grobid.core.factory.AbstractEngineFactory.init(AbstractEngineFactory.java:72)
	at org.grobid.service.GrobidRestService.<init>(GrobidRestService.java:83)
	at org.grobid.service.GrobidRestService$$FastClassByGuice$$30b2a4.GUICE$TRAMPOLINE(<generated>)
	at org.grobid.service.GrobidRestService$$FastClassByGuice$$30b2a4.apply(<generated>)
	at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
	at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)
	... 12 more

@AaronNGray
Copy link
Author

#1230

@AaronNGray
Copy link
Author

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