retype
retype copied to clipboard
ERROR: Could not find a part of the path '/dev/fd/108'
I am totally clueless why this is happening. Any help pls. As for the system: I am running docker on an arm64-based instance. I was using retype on my arm64 instance some months ago, but when I tried today, it didn't work. The last time when it worked without error, I was using .NET 5 SDK instead of version 6. Maybe that can be the error. I will try out and reply back here. In the meantime, I am attaching the Error logs with .NET 6 SDK on arm64 alpine Docker Image.
Dockerfile:
# Base Image: Alpine for building Retype
FROM alpine as build
# Installing dotnet 6
RUN apk update && apk add bash curl wget tar openssl libgcc libstdc++ ncurses-libs
RUN wget https://download.visualstudio.microsoft.com/download/pr/4bd2399a-e0e9-43a6-9767-ac15dd430b1c/3dd4307a1ce811e31>RUN mkdir /lib/dotnet-arm64 && tar zxf /tmp/dotnet-sdk-6.0.301-linux-arm64.tar.gz -C /lib/dotnet-arm64
ENV DOTNET_ROOT=/lib/dotnet-arm64
ENV PATH=/lib/dotnet-arm64:$PATH
ENV PATH=$PATH:/root/.dotnet/tools
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
# Building Retype
WORKDIR .
COPY . .
# RUN npm install
RUN dotnet tool install --global retypeapp
# RUN ls -la /dev/fd
# RUN ls -la /proc/self/fd/
# RUN touch /proc/self/fd/108
RUN retype build
# Base Image: Node for running server
FROM node:16-bullseye
....
Error:
ERROR: Could not find a part of the path '/dev/fd/108'.
System.IO.DirectoryNotFoundException: Could not find a part of the path '/dev/fd/108'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
at Retype.App.IO.FileSystem.EnumerateDirectories(IDirectoryDescriptor parentDirectory, String searchPattern, SearchOption searchOption, String newBasePath)+MoveNext()
at Retype.App.Jobs.InputDiscoveryJob.DiscoverInputs(InputDiscoveryJobArgs args, FilterRule[] rules, Int32& pageCount)
at Retype.App.Jobs.InputDiscoveryJob.Run(InputDiscoveryJobArgs args)
at Retype.App.Jobs.Job`2.RunAsync(TArgs args)
at Retype.App.Jobs.Job`2.RunAsync(Object args, PipelineState state)
at Retype.App.Pipelines.Pipeline`3.ExecuteAsync(TInitial initialValue, TState state)
at Retype.App.Services.RetypeBuildService.DiscoverPagesAsync(Result assets, List`1 allBuildItems, IBuildOptions options, BuildStats stats)
at Retype.App.Services.RetypeBuildService.BuildAsync(IBuildOptions options, Boolean verbose)
at Retype.App.Services.CliService.BuildCommandHandler(Boolean verbose, IBuildOptions options, String path, String output, String secret, String overrideJson, String host, Nullable`1 port, Boolean isWatch, Boolean isRefresh, String hostUrl)
at Retype.App.Services.CliService.<CreateBuildCommand>b__19_0(Boolean verbose, String output, String secret, String override, String path)
at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location ---
at Retype.App.Services.CliService.<>c__DisplayClass23_0.<<CreateInfoOption>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
The command '/bin/sh -c retype build' returned a non-zero code: 1
ERROR: Service 'sshot' failed to build : Build failed
Same error with
- .NET 5 with retype version 1.11.2 (as this supports .NET 5) on alpine image
- .NET 6 with latest retype on Ubuntu 18.04 docker image
- .NET 6 with latest retype on Ubuntu 18.04 docker image on amd64 (play with docker)
bump
Retype has published official Docker images at https://hub.docker.com/r/retypeapp/retype.
Maybe one of those images would help avoid this error.
https://hub.docker.com/layers/retype/retypeapp/retype/latest-alpine-amd64/images/sha256-9c22428f2bfe982040c4dea9f3be92f175f7a2d0143db9ca5c8d24ab4de5ec21?context=explore
I think this issue can be safely closed and discarded as this is not specific to Retype but to .NET and how it doesn't properly use file descriptors in Linux. I've seen this error in other .NET projects, which have no relation whatsoever to Retype.
Short summary:
In some .NET versions the file system libraries are trying to use /dev/fd/ as it is /proc/ (this is how WSL works, so no surprise there). Most commonly on *NIX systems the file descriptors in /dev/fd/ are actually a symlink to the "self" process, to allow processes to more easily navigate to their own descriptors for input, output, and error. Trying to use /dev/fd/{PROC_ID} is wrong, it would be correct if it was /proc/{PROC_ID}, hence the error.