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

LPD-47903 NPE in HttpInvoker due to httpURLConnection.getErrorStream returning null #2502

Closed

Conversation

jonathanmccann
Copy link

What is this trying to solve?

https://liferay.atlassian.net/browse/LPD-47903

How am I fixing it?

In certain cases httpURLConnection.getErrorStream() can return null as defined in the spec - https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/HttpURLConnection.html#getErrorStream()

This was caught in one of Site Management's tests where we expect the action to fail and confirm it fails with the correct status code.

I updated the template to only process the inputStream if it exists. Please let me know your thoughts on the change and if you see an alternative approach that you would prefer instead. Thank you.

How can you verify that it works?

In headless-site-test run gw testIntegration --tests *.SiteResourceTest

@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:sf

@jonathanmccann
Copy link
Author

ci:test:relevant

@jonathanmccann
Copy link
Author

ci:test:site-management

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 3 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 66f99d62f2c96f3635e67a98785c2c309bc1e0c4

Sender Branch:

Branch Name: LPD-47903
Branch GIT ID: 4c46a0e16884c263b35e52d5f0bf5111c4da62c3

1 out of 1jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:site-management - 115 out of 123 jobs passed in 2 hours 7 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 66f99d62f2c96f3635e67a98785c2c309bc1e0c4

Upstream Comparison:

Branch GIT ID: 66f99d62f2c96f3635e67a98785c2c309bc1e0c4
Jenkins Build URL: EE Development Acceptance (master) - 1158 - 2025-01-31[08:36:12]

ci:test:site-management - 115 out of 123 jobs PASSED

8 Failed Jobs:

115 Successful Jobs:
    For more details click here.

    Failures unique to this pull:

    1. ...
    Test bundle downloads:

    @liferay-continuous-integration
    Copy link
    Collaborator

    @liferay-continuous-integration
    Copy link
    Collaborator

    ✔️ ci:test:stable - 25 out of 25 jobs passed

    ❌ ci:test:relevant - 73 out of 93 jobs passed in 2 hours 25 minutes

    Click here for more details.

    Base Branch:

    Branch Name: master
    Branch GIT ID: 66f99d62f2c96f3635e67a98785c2c309bc1e0c4

    Upstream Comparison:

    Branch GIT ID: 66f99d62f2c96f3635e67a98785c2c309bc1e0c4
    Jenkins Build URL: EE Development Acceptance (master) - 1158 - 2025-01-31[08:36:12]

    ci:test:stable - 25 out of 25 jobs PASSED
    25 Successful Jobs:
      ci:test:relevant - 73 out of 93 jobs PASSED

      20 Failed Jobs:

      73 Successful Jobs:
        For more details click here.

        Failures unique to this pull:


        Failures in common with acceptance upstream results at 66f99d6:
        1. ...
        Test bundle downloads:

        @liferay-continuous-integration
        Copy link
        Collaborator

        @albertojml albertojml self-requested a review February 4, 2025 09:21
        @albertojml
        Copy link
        Collaborator

        ci:test:relevant

        Copy link
        Collaborator

        @albertojml albertojml left a comment

        Choose a reason for hiding this comment

        The reason will be displayed to describe this comment to others. Learn more.

        Looks good to me. I've relaunched the tests just to make sure everything is working as expected since it seems the previous execution ran into many issues.

        If everything works I will forward it. Thanks!

        @liferay-continuous-integration
        Copy link
        Collaborator

        ✔️ ci:test:stable - 25 out of 25 jobs passed

        ❌ ci:test:relevant - 77 out of 102 jobs passed in 3 hours 24 minutes

        Click here for more details.

        Base Branch:

        Branch Name: master
        Branch GIT ID: 5a1b51d1511d7580bf1c1e95834f6ecbb25dcf9a

        Upstream Comparison:

        Branch GIT ID: 5a1b51d1511d7580bf1c1e95834f6ecbb25dcf9a
        Jenkins Build URL: EE Development Acceptance (master) - 1168 - 2025-02-05[00:57:16]

        ci:test:stable - 25 out of 25 jobs PASSED
        25 Successful Jobs:
          ci:test:relevant - 77 out of 102 jobs PASSED

          25 Failed Jobs:

          77 Successful Jobs:
            For more details click here.

            Failures unique to this pull:

            1. modules-integration-mysql57/1/24
              record-testray-logs:
              [beanshell] INFO: Using GOOGLE_APPLICATION_CREDENTIALS=/root/.gcloud/ci-testray.json
              [beanshell] Unable to delete because file does not exist /opt/dev/projects/github/liferay-jenkins-ee/testray/prepared_s3_logs
              [beanshell] Unable to delete because file does not exist /opt/dev/projects/github/liferay-jenkins-ee/testray/recorded_logs
              [beanshell] Created cache file in /tmp/jenkins-cached-files/1693109501.txt
              [beanshell] Executing commands: git remote -v
              [beanshell] Found Git remotes: github-dev, origin, upstream
              [beanshell] Created S3 Object https://storage.cloud.google.com/testray-results/2025-02/test-1-40/test-portal-acceptance-pullrequest(master)/12941/modules-integration-mysql57/1/24/jenkins-console.txt.gz in 324 ms
              [stopwatch] [run.current.job: 5:50.839 sec]
              [beanshell] Created cache file in /tmp/jenkins-cached-files/1693109501.txt
              

              BUILD FAILED
              /opt/dev/projects/github/liferay-jenkins-ee/commands/build-common.xml:15406: The following error occurred while executing this line:
              /opt/dev/projects/github/liferay-portal/build-test-batch.xml:7417: The following error occurred while executing this line:
              /opt/dev/projects/github/liferay-portal/build-test-batch.xml:2398: The following error occurred while executing this line:
              /opt/dev/projects/github/liferay-portal/build-test-batch.xml:2583: The following error occurred while executing this line:
              /opt/dev/projects/github/liferay-portal/build-test-batch.xml:1119: The following error occurred while executing this line:
              /opt/dev/projects/github/liferay-portal/build.xml:964: The following error occurred while executing this line:
              /opt/dev/projects/github/liferay-portal/build-common.xml:1698: The following error occurred while executing this line:
              /opt/dev/projects/github/liferay-portal/build-common.xml:1041: Unable to execute Gradle task: setUpLibs.

              1. com.liferay.jenkins.Jenkins
              2. com.liferay.headless.admin.site.resource.v1_0.test.DisplayPageTemplateResourceTest.testDeleteSiteSiteByExternalReferenceCodeDisplayPageTemplate - UNTESTED
              3. com.liferay.headless.admin.site.resource.v1_0.test.DisplayPageTemplateResourceTest.testGetSiteSiteByExternalReferenceCodeDisplayPageTemplate - UNTESTED
              4. ...
            2. modules-integration-mysql57/0/6
              1. com.liferay.headless.commerce.delivery.cart.resource.v1_0.test.TermResourceTest.testClientSerDesToDTO - UNTESTED
              2. com.liferay.headless.commerce.delivery.cart.resource.v1_0.test.TermResourceTest.testClientSerDesToJSON - UNTESTED
              3. com.liferay.headless.commerce.delivery.cart.resource.v1_0.test.TermResourceTest.testEscapeRegexInStringFields - UNTESTED
              4. ...
            3. modules-integration-mysql57/0/7
              1. com.liferay.portal.workflow.kaleo.service.persistence.test.KaleoLogPersistenceTest.testCreate - UNTESTED
              2. com.liferay.portal.workflow.kaleo.service.persistence.test.KaleoLogPersistenceTest.testRemove - UNTESTED
              3. com.liferay.portal.workflow.kaleo.service.persistence.test.KaleoLogPersistenceTest.testUpdateNew - UNTESTED
              4. ...
            4. modules-integration-mysql57/0/10
              1. com.liferay.commerce.wish.list.service.internal.model.listener.test.GroupModelListenerTest.testOnBeforeRemove - UNTESTED
              2. com.liferay.portal.language.override.service.persistence.test.PLOEntryPersistenceTest.testCreate - UNTESTED
              3. com.liferay.portal.language.override.service.persistence.test.PLOEntryPersistenceTest.testRemove - UNTESTED
              4. ...
            5. modules-integration-mysql57/0/11
              1. com.liferay.dynamic.data.mapping.change.tracking.test.DDMFormInstanceReportTableReferenceDefinitionTest.testDiscardCTEntry - UNTESTED
              2. com.liferay.dynamic.data.mapping.upgrade.v3_9_1.test.UpgradeDDMStructureTest.testUpgradeDDMFormFieldOptionsReferences - UNTESTED
              3. com.liferay.dynamic.data.mapping.upgrade.v3_9_1.test.UpgradeDDMStructureTest.testUpgradeDDMFormFieldReferences - UNTESTED
              4. ...
            6. ...
            Test bundle downloads:

            @liferay-continuous-integration
            Copy link
            Collaborator

            @albertojml
            Copy link
            Collaborator

            Failures don't seem related. I'm forwarding it.

            @albertojml
            Copy link
            Collaborator

            ci:forward

            @liferay-continuous-integration
            Copy link
            Collaborator

            CI is automatically triggering the following test suites:

            •     ci:test:relevant
            •     ci:test:sf
            •     ci:test:stable

            The pull request will automatically be forwarded to the user brianchandotcom If the following test suites pass:

            •     ci:test:relevant
            •     ci:test:sf
            •     ci:test:stable

            @liferay-continuous-integration
            Copy link
            Collaborator

            Skipping previously passed test suites:

            • ci:test:sf
            • ci:test:stable

            @liferay-continuous-integration
            Copy link
            Collaborator

            ✔️ ci:test:stable - 25 out of 25 jobs passed

            ❌ ci:test:relevant - 78 out of 99 jobs passed in 3 hours 10 minutes

            Click here for more details.

            This pull is eligible for reevaluation. When this upstream build has completed, using the following CI command will compare this pull request result against a more recent upstream result:

            ci:reevaluate:1377401_20218

            Base Branch:

            Branch Name: master
            Branch GIT ID: 551dad365312e3592fd19eaabe2a0ca75d52fa62

            Upstream Comparison:

            Branch GIT ID: 5a1b51d1511d7580bf1c1e95834f6ecbb25dcf9a
            Jenkins Build URL: EE Development Acceptance (master) - 1168 - 2025-02-05[00:57:16]

            ci:test:stable - 25 out of 25 jobs PASSED
            25 Successful Jobs:
              ci:test:relevant - 78 out of 99 jobs PASSED

              21 Failed Jobs:

              78 Successful Jobs:
                For more details click here.

                Failures unique to this pull:


                Failures in common with acceptance upstream results at 5a1b51d:
                1. ...
                Test bundle downloads:

                @liferay-continuous-integration
                Copy link
                Collaborator

                @albertojml
                Copy link
                Collaborator

                ci:forward:force

                @liferay-continuous-integration
                Copy link
                Collaborator

                CI is automatically triggering the following test suites:

                •     ci:test:relevant
                •     ci:test:sf
                •     ci:test:stable

                The pull request will automatically be forwarded to the user brianchandotcom if the following test suites complete:

                •     ci:test:relevant
                •     ci:test:sf
                  AND If the following test suites pass:
                •     ci:test:stable

                @liferay-continuous-integration
                Copy link
                Collaborator

                Skipping previously completed test suites:

                • ci:test:relevant
                • ci:test:sf
                  AND Skipping previously passed test suites:
                • ci:test:stable

                @liferay-continuous-integration
                Copy link
                Collaborator

                All required test suite(s) completed.
                Forwarding pull request to brianchandotcom.
                Console

                @liferay-continuous-integration
                Copy link
                Collaborator

                Pull request has been successfully forwarded to brianchandotcom#158550
                Console

                Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
                Projects
                None yet
                Development

                Successfully merging this pull request may close these issues.

                5 participants