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

LPS-117287 Web Content article Publish button stops working #171

Closed
wants to merge 1 commit into from

Conversation

markocikos
Copy link
Collaborator

This is a bugfix, see description in https://issues.liferay.com/browse/LPS-117287

The issue is caused by CKEditor and AlloyEditor(s) on the same page. There is a race condition on navigate (back or Publish), and CKEditor instance may delete CKEDITOR global object before AlloyEditor instances are destroyed. This is the same fix as in React-based Editor and AlloyEditor.


The race scenario causes Publish button to sporadically stops working, and this PR fixes it. But, the console error in ticket description does not match this scenario. The error that happens is

async.js:26 Uncaught ReferenceError: CKEDITOR is not defined
    at CKEDITOR.dom.document.getWindow (ckeditor.js?browserId=chrome&languageId=en_US&b=7310&t=1595861504326:90)
...

The error in ticket description is

ckeditor.js?browserId=other&minifierType=js&languageId=en_US&b=7210&t=1592928320518:972 Uncaught TypeError: Cannot read property 'data' of undefined
    at h (VM179 ckeditor.js:972)
...

I sporadically got this error when quickly navigating before page loads, and this PR does not fix it. But, this error looks unrelated to the problem of this ticket:

  • It does not break the Publish button or other UI features.
  • It is much harder to replicate then the undefined CKEDITOR, happens around every 20+ navigations, while undefined happens every 3-4 times and can be reliably provoked
  • It happens on page open, a click listener is not initialized correctly, so click fires the error. This seemingly has no other effect besides an error in log. In contrast, the undefined CKEDITOR happens once when navigating away from page, and breaks a lot of UI.

I gave up on trying to find the root cause of data issue, as it looks to be deep in base CKeditor. I think we can ignore it for now.

@liferay-continuous-integration
Copy link
Collaborator

To conserve resources, the PR Tester does not automatically run for every pull.

If your code changes were already tested in another pull, reference that pull in this pull so the test results can be analyzed.

If your pull was never tested, comment "ci:test" to run the PR Tester for this pull.

@markocikos markocikos requested a review from jbalsas July 27, 2020 15:28
@markocikos
Copy link
Collaborator Author

ci:test:sf

@markocikos
Copy link
Collaborator Author

ci:test:relevant

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:sf - 0 out of 1 jobs passed in 3 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: ae294d94fe8f2a5d93da8fc5714cd71e5908eb9d

Sender Branch:

Branch Name: LPS-117287
Branch GIT ID: 1ac26c6284924cc073d555d6f90d32d84bb5a6bc

0 out of 1jobs PASSED
For more details click here.
     [java] 	at com.liferay.source.formatter.SourceFormatter.main(SourceFormatter.java:160)
[stopwatch] [run.batch.test.action: 1:48.367 sec]
     [echo] The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:567: The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:707: Java returned: 1
      [get] Getting: http://test-1-20/job/test-portal-source-format/3681//consoleText
      [get] To: /opt/dev/projects/github/liferay-portal/20200727083553308.txt
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/20200727083553308.txt
  [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/null310585497.properties

merge-test-results:
[mkdir] Created dir: /opt/dev/projects/github/liferay-portal/test-results
[junitreport] Processing /opt/dev/projects/github/liferay-portal/test-results/TESTS-TestSuites.xml to /tmp/null706721410
[junitreport] Loading stylesheet jar:file:/opt/java/ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 269ms
[junitreport] Deleting: /tmp/null706721410
[echo] A report with all the test results can be found at test-results/html/index.html.
[mkdir] Created dir: /opt/dev/projects/github/liferay-jenkins-ee/test-results
[copy] Copying 1 file to /opt/dev/projects/github/liferay-jenkins-ee/test-results
[echo] run.batch.test.tear.down.start.timestamp: 07-27-2020 08:35:58:417 PDT
[stopwatch] [run.batch.test.tear.down: 0.000 sec]
[echo]
[echo] Ant GC log:
[echo]
[echo] Java HotSpot(TM) 64-Bit Server VM (25.121-b13) for linux-amd64 JRE (1.8.0_121-b13), built on Dec 12 2016 16:36:53 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
[echo] Memory: 4k page, physical 32902080k(14998300k free), swap 0k(0k free)

@liferay-continuous-integration
Copy link
Collaborator

@markocikos
Copy link
Collaborator Author

@PablitoBonito See #171 (comment), that's an example of what I was talking about today 🙂 . CI is complaining about source formatting, but reporting an unintelligible error. /cc @john-co

No errors locally:
screen

@john-co
Copy link

john-co commented Jul 27, 2020

ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

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

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: ae294d94fe8f2a5d93da8fc5714cd71e5908eb9d

Sender Branch:

Branch Name: LPS-117287
Branch GIT ID: 1ac26c6284924cc073d555d6f90d32d84bb5a6bc

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

@liferay-continuous-integration
Copy link
Collaborator

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

✔️ ci:test:relevant - 45 out of 45 jobs passed in 2 hours 32 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: ae294d94fe8f2a5d93da8fc5714cd71e5908eb9d

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 2aa558d7587a046d654b60e91d9b21cb5e106df3

ci:test:stable - 20 out of 20 jobs PASSED
20 Successful Jobs:
ci:test:relevant - 45 out of 45 jobs PASSED
45 Successful Jobs:
For more details click here.

@john-co
Copy link

john-co commented Jul 27, 2020

Hi @kenjiheigel, possibly a flaky out of memory issue with CI on the previous SF error?

     [echo] Ant GC log:
     [echo] 
     [echo] Java HotSpot(TM) 64-Bit Server VM (25.121-b13) for linux-amd64 JRE (1.8.0_121-b13), built on Dec 12 2016 16:36:53 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
     [echo] Memory: 4k page, physical 32902080k(14998300k free), swap 0k(0k free)
     [echo] CommandLine flags: -XX:-BytecodeVerificationLocal -XX:-BytecodeVerificationRemote -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/ant-oom-heap-dump.bin -XX:InitialHeapSize=1073741824 -XX:InitialTenuringThreshold=0 -XX:MaxHeapSize=3221225472 -XX:MaxMetaspaceSize=536870912 -XX:MaxNewSize=536870912 -XX:MaxTenuringThreshold=0 -XX:MetaspaceSize=104857600 -XX:NewSize=268435456 -XX:+PrintGC -XX:+PrintGCCause -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:SurvivorRatio=65536 -XX:TargetSurvivorRatio=0 -XX:ThreadStackSize=2048 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelOldGC 
     [echo] 1.230: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 261120K->20245K(1048064K), 0.0122506 secs] [Times: user=0.07 sys=0.02, real=0.01 secs] 
     [echo] 3.175: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 281365K->37581K(1048064K), 0.0093438 secs] [Times: user=0.06 sys=0.01, real=0.01 secs] 
     [echo] 5.558: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 298701K->40540K(1048064K), 0.0029371 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
     [echo] 6.797: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 301660K->47274K(1048064K), 0.0034981 secs] [Times: user=0.02 sys=0.00, real=0.01 secs] 
     [echo] 8.158: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 308394K->57747K(1048064K), 0.0071690 secs] [Times: user=0.04 sys=0.00, real=0.00 secs] 
     [echo] 10.786.731: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 327131K->81578K(1048064K), 0.0067854 secs] [Times: user=0.04 sys=0.01, real=0.01 sec14.9178.885: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 342698K->95577K(1048064K), 0.0232938 secs] [Times: user=0.12 sys=0.00, real=0.03 secs] 
     [echo] 180.011: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 356697K->129433K(1048064K), 0.0215029 secs] [Times: user=0.09 sys=0.02, real=0.02 secs] 
     [echo] 181.167: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 390553K->169033K(1048064K), 0.0183446 secs] [Times: user=0.11 sys=0.01, real=0.01 secs] 
     [echo] 182.200: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 430153K->204353K(1048064K), 0.0258447 secs] [Times: user=0.16 sys=0.01, real=0.02 secs] 
     [echo] 183.362: [GC (Allocation Failure) [PSYoungGen: 261120K->0K(261632K)] 465473K->243801K(1048064K), 0.0330510 secs] [Times: user=0.11 sys=0.01, real=0.04 secs] 
     [echo] 
     [echo] 					

BUILD FAILED
/opt/dev/projects/github/liferay-jenkins-ee/commands/build-common.xml:12078: The following error occurred while executing this line:
/opt/dev/projects/github/liferay-jenkins-ee/commands/build-test-portal-source-format.xml:357: The following error occurred while executing this line:
/opt/dev/projects/github/liferay-portal/build-test-batch.xml:6518: The following error occurred while executing this line:
/opt/dev/projects/github/liferay-portal/build-test-batch.xml:1313: /opt/dev/projects/github/liferay-portal/build-test-batch.xml:6554: The following error occurred while executing this line:
/opt/dev/projects/github/liferay-portal/portal-impl/build.xml:567: The following error occurred while executing this line:
/opt/dev/projects/github/liferay-portal/portal-impl/build.xml:707: Java returned: 1

@john-co
Copy link

john-co commented Jul 27, 2020

Taking a closer look, it might be network issue related trying to load maven?

  [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/null310585497.properties

format-source:
  [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/null310585497.properties

format-source-files:
     [java] Java Result: 1
     [echo] 
     [echo] There are no modified files on the current branch (markocikos-171-LPS-117287).
     [echo] Executing Source Formatter task on all files.
     [echo] 
     [java] java.lang.NullPointerException
     [java] 	at com.liferay.portal.tools.GitUtil._getLatestCommitId(GitUtil.java:517)
     [java] 	at com.liferay.portal.tools.GitUtil.getCurrentBranchFileNames(GitUtil.java:87)
     [java] 	at com.liferay.source.formatter.SourceFormatter.main(SourceFormatter.java:160)
[stopwatch] [run.batch.test.action: 1:48.367 sec]
     [echo] The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:567: The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:707: Java returned: 1
      [get] Getting: http://test-1-20/job/test-portal-source-format/3681//consoleText
      [get] To: /opt/dev/projects/github/liferay-portal/20200727083553308.txt
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/20200727083553308.txt
  [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/null310585497.properties

cc/ @kenjiheigel

@liferay-continuous-integration
Copy link
Collaborator

@jbalsas
Copy link

jbalsas commented Jul 28, 2020

ci:forward

@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

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

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:relevant
ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

All required test suite(s) passed.
Forwarding pullrequest to brianchandotcom.

@liferay-continuous-integration
Copy link
Collaborator

Pull request has been successfully forwarded to brianchandotcom#91893

@wincent
Copy link

wincent commented Jul 29, 2020

Taking a closer look, it might be network issue related trying to load maven?

(For posterity) same failure as reported here.

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.

None yet

5 participants