IQSS / IQSS/dataverse

maven test run fails on OpenSuse

Open
#9,947 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: None Type: Bug User Role: Sysadmin
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

What steps does it take to reproduce the issue?
Run "mvn package" or "mvn test" on (OpenSuse Tumbleweed/Leap 15) linux systems.

  • When does this issue occur?
    On systems where file "/etc/hosts" does not contain other entries than localhost.

  • What happens?
    Tests fail. In SystemConfig.java "null" is returned from

try {
            return "https://" + InetAddress.getLocalHost().getCanonicalHostName();
        } catch (UnknownHostException e) {
            return null;
        }

because InetAddress.getLocalHost() from java.net throws UnknowHostException. (getCanonicalHostName searches for name in /etc/hosts). This lets e.g.

job.add("includedInDataCatalog", Json.createObjectBuilder()
                .add("@type", "DataCatalog")
                .add("name", installationBrandName)
                .add("url", SystemConfig.getDataverseSiteUrlStatic())

in DatasetVersion.java fail.

  • To whom does it occur (all users, curators, superusers)?
    Users on OpenSuse systems trying to compile dataverse

  • What did you expect to happen?
    Test should pass

Which version of Dataverse are you using?
v5.14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading SystemConfig.java, especially the hostname lookup that returns null, and DatasetVersion.java where getDataverseSiteUrlStatic() is used. Run mvn test or mvn package on an OpenSuse system whose /etc/hosts contains only localhost. Done means the affected tests pass without requiring additional host entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.