链接数据剧院| standard_init_linux.go:195:exec用户进程导致"没有这样的文件或目录"

时间:2018-03-01 07:46:06

标签: docker docker-compose dockerfile virtuoso

为git项目运行As per Android studio team:Linked-Data-Theater 我收到错误docker-compose up

下面是堆栈跟踪

standard_init_linux.go:195: exec user process caused "no such file or directory

在此堆栈跟踪中,您可以看到ifour.techno@ifour-137 MINGW64 /d/test/Docker/LinkData_Theater_Repo/Linked-Data-Theatre (master) $ docker-compose up Starting virtuoso ... Starting ldt ... done Attaching to virtuoso, ldt virtuoso | standard_init_linux.go:195: exec user process caused "no such file or directory" ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Server version: Apache Tomcat/7.0.85 ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Server built: Feb 7 2018 18:52:33 UTC ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Server number: 7.0.85.0 ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: OS Name: Linux ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: OS Version: 4.4.111-boot2docker ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Architecture: amd64 ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: JVM Version: 1.8.0_151-8u151-b12-1~deb9u1-b12 ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: JVM Vendor: Oracle Corporation ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: CATALINA_BASE: /usr/local/tomcat ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: CATALINA_HOME: /usr/local/tomcat virtuoso exited with code 1 ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Command line argument: -Dignore.endorsed.dirs= ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Command line argument: -Dcatalina.base=/usr/local/tomcat ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Command line argument: -Dcatalina.home=/usr/local/tomcat ldt | Mar 01, 2018 7:35:47 AM org.apache.catalina.startup.VersionLoggerListener log ldt | INFO: Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp ldt | Mar 01, 2018 7:35:48 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent ldt | INFO: Loaded APR based Apache Tomcat Native library 1.2.16 using APR version 1.5.2. ldt | Mar 01, 2018 7:35:48 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent ldt | INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. ldt | Mar 01, 2018 7:35:48 AM org.apache.catalina.core.AprLifecycleListener initializeSSL ldt | INFO: OpenSSL successfully initialized (OpenSSL 1.1.0f 25 May 2017) ldt | Mar 01, 2018 7:35:48 AM org.apache.coyote.AbstractProtocol init ldt | INFO: Initializing ProtocolHandler ["http-apr-8080"] ldt | Mar 01, 2018 7:35:48 AM org.apache.coyote.AbstractProtocol init ldt | INFO: Initializing ProtocolHandler ["ajp-apr-8009"] ldt | Mar 01, 2018 7:35:48 AM org.apache.catalina.startup.Catalina load ldt | INFO: Initialization processed in 890 ms ldt | Mar 01, 2018 7:35:48 AM org.apache.catalina.core.StandardService startInternal ldt | INFO: Starting service Catalina ldt | Mar 01, 2018 7:35:48 AM org.apache.catalina.core.StandardEngine startInternal ldt | INFO: Starting Servlet Engine: Apache Tomcat/7.0.85 ldt | Mar 01, 2018 7:35:48 AM org.apache.coyote.AbstractProtocol start ldt | INFO: Starting ProtocolHandler ["http-apr-8080"] ldt | Mar 01, 2018 7:35:48 AM org.apache.coyote.AbstractProtocol start ldt | INFO: Starting ProtocolHandler ["ajp-apr-8009"]

下面是我的standard_init_linux.go:195: exec user process caused "no such file or directory文件,

docker-compose.yml

缺少什么?我是码头工的初学者所以请帮我解决这个问题也给我建议。我用谷歌搜索了它,但在任何地方都找不到问题解决方案。

我也试过了version: '2' services: ldt: privileged: true container_name: ldt image: tomcat:7-jre8 hostname: ldt.local ports: - "8080:8080" volumes: - ./webapps:/usr/local/tomcat/webapps - ./shared_import:/usr/local/tomcat/temp:z networks: - ldt virtuoso: privileged: true container_name: virtuoso build: context: virtuoso hostname: virtuoso.local ports: - "1111:1111" - "8890:8890" environment: DBA_PASSWORD: "dba" SPARQL_UPDATE: "true" VIRTUOSO_DBA_PWD: dba volumes: - ./virtuoso_data:/var/lib/virtuoso/db:z - ./shared_import:/var/lib/virtuoso/usr/local/tomcat/temp:z networks: - ldt networks: ldt: external: name: ldt ,但得到了与上面相同的错误。

2 个答案:

答案 0 :(得分:0)

您遇到的问题可能有几个原因,我通过尝试以下方法解决了同样的问题: -

  1. 确保所有文件夹都存在,在docker compose
  2. 中看起来很好
  3. 将一些shell脚本文件从windows复制到unix docker容器,确保在复制后执行dos2unix命令。虽然添加了复制特殊字符,但可能会导致上述问题。
  4. 请添加您的docker文件,其可能的问题是在docker文件中,而不是在docker-compose中

答案 1 :(得分:0)

如果您使用 Windows 作为主机操作系统,则此答案适用。

Yml文件不允许查明问题的确切位置。 问题似乎出在您的virtuoso容器中。您需要查看此容器启动时运行的文件。它的.sh文件很有可能具有错误的行尾格式。文件中的行尾在某些时候从Unix格式(LF)转换为Windows格式(CR LF)。

如果这种转换发生在将在Docker容器中运行的.sh文件中,则Linux将无法识别行尾的Windows格式,并将整个文件视为一行。它将导致类似 standard_init_linux.go:XXX的错误:exec用户进程导致“没有这样的文件或目录”

原因

可能发生EOL转换,因为以下原因之一:

  • 您的本地Git配置为在您git pull来源时自动将行尾转换为Windows格式(autocrlf = true)
  • 您在Windows的某个编辑器中保存了一个文件,因此文件的行尾以CR LF
  • 保存。

解决方案

  • 作为快速解决方案,您可以在Notepad ++中打开文件,进入菜单Edit / EOL Conversion / Unix,然后保存文件
  • 另一个快速修复:使用CLI工具dos2unix从命令行转换文件
  • 通过关闭自动转换为Windows EOL格式来更改git配置:
  

git config --global core.autocrlf输入

它将全局更改设置,针对计算机上的所有存储库

您也可以每个存储库进行设置。 有关更多详细信息,请参见https://help.github.com/articles/dealing-with-line-endings/