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

Backend tests failing with Ubuntu 22.04 #1768

Open
imnasnainaec opened this issue Dec 9, 2022 · 3 comments
Open

Backend tests failing with Ubuntu 22.04 #1768

imnasnainaec opened this issue Dec 9, 2022 · 3 comments
Labels
backend bug Something isn't working

Comments

@imnasnainaec
Copy link
Collaborator

Our Github actions (https://github.com/sillsdev/TheCombine/blob/master/.github/workflows/backend.yml) use runs-on: ubuntu-latest, which went from 20.04 to 22.04 in October 2022 (https://github.blog/changelog/2022-11-09-github-actions-ubuntu-latest-workflows-will-use-ubuntu-22-04/).

It seems that Ubuntu 22.04 no longer has a libdl.so library, whose functionality was absorbed into libc (https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html). However, libdl.so is expected by one of our dependencies (https://github.com/sillsdev/icu-dotnet/search?q=libdl). This results in the following failure of our backend test:

A total of 1 test files matched the specified pattern.
  Failed TestRoundtrip(Backend.Tests.Controllers.LiftControllerTests+RoundTripObj) [5 s]
  Error Message:
   System.AggregateException : One or more errors occurred. (Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl.so: cannot open shared object file: No such file or directory)
  ----> System.DllNotFoundException : Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl.so: cannot open shared object file: No such file or directory
  Stack Trace:
     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Backend.Tests.Controllers.LiftControllerTests.TestRoundtrip(RoundTripObj roundTripObj) in /home/runner/work/TheCombine/TheCombine/Backend.Tests/Controllers/LiftControllerTests.cs:line 332
--DllNotFoundException
   at Icu.NativeMethods.dlopen(String file, Int32 mode)
   at Icu.NativeMethods.GetIcuLibHandle(String basename, Int32 icuVersion)
   at Icu.NativeMethods.LoadIcuLibrary(String libraryName)
   at Icu.NativeMethods.get_IcuCommonLibHandle()
   at Icu.NativeMethods.uset_open(Char start, Char end)
   at Icu.UnicodeSet.ToPattern(IEnumerable`1 set)
   at SIL.WritingSystems.LdmlDataMapper.WriteCharactersElement(XElement charactersElem, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.WriteLdml(XmlWriter writer, XElement element, WritingSystemDefinition ws)
   at SIL.WritingSystems.LdmlDataMapper.Write(String filePath, WritingSystemDefinition ws, Stream oldFile)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.SaveDefinition(T ws)
   at SIL.WritingSystems.LdmlInFolderWritingSystemRepository`1.Save()
   at BackendFramework.Services.LiftService.LdmlExport(String filePath, String vernacularBcp47, List`1 validChars) in /home/runner/work/TheCombine/TheCombine/Backend/Services/LiftService.cs:line 489
   at BackendFramework.Services.LiftService.LiftExport(String projectId, IWordRepository wordRepo, IProjectRepository projRepo) in /home/runner/work/TheCombine/TheCombine/Backend/Services/LiftService.cs:line 345
   at BackendFramework.Controllers.LiftController.CreateLiftExport(String projectId) in /home/runner/work/TheCombine/TheCombine/Backend/Controllers/LiftController.cs:line [25](https://github.com/sillsdev/TheCombine/actions/runs/3631375631/jobs/6125926644#step:4:26)9
  Failed TestRoundtrip(Backend.Tests.Controllers.LiftControllerTests+RoundTripObj) [3 s]```
@ermshiperete
Copy link
Member

This happens if the icu.net.dll.config doesn't get copied next to icu.net.dll, because that tells the name of the shared library to load (in this case libdl.so.2).

You'll have to do the following:

  • update icu.net to the latest 2.9.x pre-release because older versions didn't include icu.net.dll.config, and it seems icu.net needs to be build for net6 in order for it to be able to pick up the config file when running under net6
  • make sure that icu.net.dll.config gets copied to the directory with the tests. This is easiest done by adding a reference to icu.net to Backend.Tests.csproj

With these changes I was able to successfully run the Backend.Tests.

papeh added a commit to sillsdev/liblcm that referenced this issue Dec 13, 2022
per a comment in sillsdev/icu-dotnet#181
sillsdev/TheCombine#1768

Change-Id: Ia1b09ac7bc0b73670c2a6e10924ae4f94e3e9adf
#issuecomment-1344645680
@imnasnainaec
Copy link
Collaborator Author

  • update icu.net to the latest 2.9.x pre-release because older versions didn't include icu.net.dll.config, and it seems icu.net needs to be build for net6 in order for it to be able to pick up the config file when running under net6

Thanks, @ermshiperete. Do we have an estimate of when a stable 2.9.x release will be available?

@ermshiperete
Copy link
Member

Since it's a shared library on sillsdev, any project that needs a new release can create one. However, I just created the 2.9.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants