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

Unable to create new pads after restoring from SQL #84

Closed
dokterbob opened this issue Nov 6, 2017 · 5 comments
Closed

Unable to create new pads after restoring from SQL #84

dokterbob opened this issue Nov 6, 2017 · 5 comments

Comments

@dokterbob
Copy link

Having restored Hackpad from an SQL export, having done a password reset and logged in, there's a 500 when trying the create a new pad.

The exception in the backend log is:

{"message":"(500,Error while executing: TypeError: Cannot read property \"title\" from null (module etherpad/pro/pro_padmeta.js#53))","date":1509974085578}

The full stacktrace from the frontend exception log is:

net.appjet.bodylock.JSRuntimeException: Error while executing: TypeError: Cannot read property "title" from null (module etherpad/pro/pro_padmeta.js#53)
	at net.appjet.bodylock.InnerExecutable.execute(bodylock.scala:84)
	at net.appjet.oui.execution$$anonfun$execute$4.apply(execution.scala:517)
	at net.appjet.oui.NoninheritedDynamicVariable.withValue(dynamicvar.scala:38)
	at net.appjet.oui.ExecutionContextUtils$.withContext(execution.scala:340)
	at net.appjet.oui.execution$.execute(execution.scala:513)
	at net.appjet.oui.execution$.runOutOfBand(execution.scala:640)
	at net.appjet.ajstdlib.execution$.runTask(ajstdlib.scala:140)
	at net.appjet.ajstdlib.execution$TaskRunner.call(ajstdlib.scala:177)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "title" from null (module etherpad/pro/pro_padmeta.js#53)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3785)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3763)
	at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3791)
	at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3810)
	at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3823)
	at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1508)
	at JS$module$etherpad$pro$pro$padmeta$js$65._c_anonymous_8(module etherpad/pro/pro_padmeta.js:53)
	at JS$module$etherpad$pro$pro$padmeta$js$65.call(module etherpad/pro/pro_padmeta.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
	at JS$module$etherpad$pad$model$js$53._c_anonymous_88(module etherpad/pad/model.js:909)
	at JS$module$etherpad$pad$model$js$53.call(module etherpad/pad/model.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
	at JS$module$etherpad$pro$pro$padmeta$js$65._c_anonymous_3(module etherpad/pro/pro_padmeta.js:162)
	at JS$module$etherpad$pro$pro$padmeta$js$65.call(module etherpad/pro/pro_padmeta.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:57)
	at JS$module$sync$js$12._c_doWithStringLock_7(module sync.js:75)
	at JS$module$sync$js$12.call(module sync.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
	at JS$module$etherpad$pro$pro$padmeta$js$65._c__doWithProPadLock_1(module etherpad/pro/pro_padmeta.js:33)
	at JS$module$etherpad$pro$pro$padmeta$js$65.call(module etherpad/pro/pro_padmeta.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
	at JS$module$etherpad$pro$pro$padmeta$js$65._c_accessProPad_2(module etherpad/pro/pro_padmeta.js:45)
	at JS$module$etherpad$pro$pro$padmeta$js$65.call(module etherpad/pro/pro_padmeta.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
	at JS$module$etherpad$pad$model$js$53._c_anonymous_87(module etherpad/pad/model.js:908)
	at JS$module$etherpad$pad$model$js$53.call(module etherpad/pad/model.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
	at JS$module$etherpad$pad$model$js$53._c_anonymous_20(module etherpad/pad/model.js:379)
	at JS$module$etherpad$pad$model$js$53.call(module etherpad/pad/model.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
	at JS$module$etherpad$pad$dbwriter$js$75._c_writePadNow_21(module etherpad/pad/dbwriter.js:343)
	at JS$module$etherpad$pad$dbwriter$js$75.call(module etherpad/pad/dbwriter.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
	at JS$module$etherpad$pad$dbwriter$js$75._c_anonymous_14(module etherpad/pad/dbwriter.js:150)
	at JS$module$etherpad$pad$dbwriter$js$75.call(module etherpad/pad/dbwriter.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
	at JS$module$etherpad$pad$model$js$53._c_anonymous_7(module etherpad/pad/model.js:997)
	at JS$module$etherpad$pad$model$js$53.call(module etherpad/pad/model.js)
	at org.mozilla.javascript.JavaAdapter.doCall(JavaAdapter.java:598)
	at org.mozilla.javascript.JavaAdapter.callMethod(JavaAdapter.java:573)
	at adapter2.apply(<adapter>)
	at net.appjet.ajstdlib.SQLBase$$anonfun$inTransaction$1$$anonfun$apply$10.apply(sqlbase.scala:121)
	at net.appjet.oui.NoninheritedDynamicVariable.withValue(dynamicvar.scala:38)
	at net.appjet.ajstdlib.SQLBase$$anonfun$inTransaction$1.apply(sqlbase.scala:116)
	at net.appjet.ajstdlib.SQLBase$$anonfun$inTransaction$1.apply(sqlbase.scala:112)
	at net.appjet.ajstdlib.SQLBase$$anonfun$withConnection$1.apply(sqlbase.scala:100)
	at net.appjet.oui.NoninheritedDynamicVariable.withValue(dynamicvar.scala:38)
	at net.appjet.ajstdlib.SQLBase.withConnection(sqlbase.scala:99)
	at net.appjet.ajstdlib.SQLBase.inTransaction(sqlbase.scala:112)
	at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
	at JS$module$sqlbase$sqlcommon$js$13._c_inTransaction_6(module sqlbase/sqlcommon.js:64)
	at JS$module$sqlbase$sqlcommon$js$13.call(module sqlbase/sqlcommon.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
	at JS$module$etherpad$pad$model$js$53._c_anonymous_6(module etherpad/pad/model.js:122)
	at JS$module$etherpad$pad$model$js$53.call(module etherpad/pad/model.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:57)
	at JS$module$sync$js$12._c_doWithStringLock_7(module sync.js:75)
	at JS$module$sync$js$12.call(module sync.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
	at JS$module$etherpad$pad$model$js$53._c_doWithPadLock_94(module etherpad/pad/model.js:1025)
	at JS$module$etherpad$pad$model$js$53.call(module etherpad/pad/model.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
	at JS$module$etherpad$pad$model$js$53._c_accessPadGlobal_5(module etherpad/pad/model.js:121)
	at JS$module$etherpad$pad$model$js$53.call(module etherpad/pad/model.js)
	at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86)
	at JS$module$etherpad$pad$dbwriter$js$75._c_taskWritePad_13(module etherpad/pad/dbwriter.js:143)
	at JS$module$etherpad$pad$dbwriter$js$75.call(module etherpad/pad/dbwriter.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
	at JS$module$main$js$140._c_anonymous_11(module main.js:210)
	at JS$module$main$js$140.call(module main.js)
	at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2521)
	at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:300)
	at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
	at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
	at JS$module$onscheduledtask$js$261._c_anonymous_1(module onscheduledtask.js:32)
	at JS$module$onscheduledtask$js$261.call(module onscheduledtask.js)
	at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:57)
	at JS$module$onscheduledtask$js$261._c_script_0(module onscheduledtask.js:17)
	at JS$module$onscheduledtask$js$261.call(module onscheduledtask.js)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
	at JS$module$onscheduledtask$js$261.call(module onscheduledtask.js)
	at JS$module$onscheduledtask$js$261.exec(module onscheduledtask.js)
	at net.appjet.bodylock.InnerExecutable$$anonfun$execute$1.apply(bodylock.scala:76)
	at net.appjet.bodylock.InnerExecutable$$anonfun$execute$1.apply(bodylock.scala:75)
	at net.appjet.bodylock.BodyLock$.runInContext(bodylock.scala:111)
	at net.appjet.bodylock.InnerExecutable.execute(bodylock.scala:75)
	... 13 more

When creating pages from a 'pristine' Hackpad it works fine. Could this be related to the Solr index not being present? @pors Any ideas? Hints? Tips? (Will happily make up for it in PR's :p)

@dokterbob
Copy link
Author

dokterbob commented Nov 6, 2017

Theory: either the global or the local pad id are different because the 'encryption' keys were not the original.

Potential strategies:

  1. Retrieve original keys which might have been accidentally left in GIT history. N/A
  2. Regenerate keys for all pads.
  3. Crack the DES key (expensive)

Question: are links to other pads dynamically generated or are the encrypted id's literally in the pad? In the latter case, 2 would break interpad links.
Note: the latter is unlikely, as that would mean existing links between pads would be broken as pad URL's would change. This suggests this is actually not an issue with the encryption of pads.

Alternative ansatz: before the actual error in the code, the generation of a new pad fails, causing a reference to a non-existant item. To be looked up.

@dokterbob
Copy link
Author

The issue is caused by the import SQL dropping previously existing stuff. Specifically, a domain with id 1. In order to make this work, it should suffice to enable the proOnly configuration option. However, it does not.

@dokterbob
Copy link
Author

Ok, this was two problems:

  1. Dropbox sync could not be properly disabled.
  2. proOnly was not configurable.

@dokterbob
Copy link
Author

Ok, this was two problems, and they are solved now.

  1. Dropbox sync could not be properly disabled. Disable dropbox fix #87
  2. proOnly was not configurable. Pro only #86

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

No branches or pull requests

1 participant