发布问题

这一章主要收集各种发布时的问题并给出解决办法。

(1)发布内容较多网页时可能会出现错误,日志信息如下所示:

{ fluid: true, noscale: true, theme: 'sitefuse', title: '用户详情页面' }

<--- Last few GCs --->

46931 ms: Scavenge 1398.0 (1450.5) -> 1398.0 (1450.5) MB, 2.3 / 0 ms [allocation failure].
46933 ms: Scavenge 1398.0 (1450.5) -> 1398.0 (1450.5) MB, 2.4 / 0 ms [allocation failure].
46935 ms: Scavenge 1398.0 (1450.5) -> 1398.0 (1450.5) MB, 2.3 / 0 ms [allocation failure].
47884 ms: Mark-sweep 1398.0 (1450.5) -> 1398.0 (1450.5) MB, 948.5 / 0 ms [last resort gc].
48837 ms: Mark-sweep 1398.0 (1450.5) -> 1398.0 (1450.5) MB, 952.8 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x145473f37399 
2: /* anonymous */ [/home/httpd/wware/node_modules/cheerio/node_modules/dom-serializer/index.js:~101] [pc=0x278c0b62b937] (this=0x145473fb7909 ,dom=0x2bab12df2669 ,opts=0xbd171cf3901 )
3: /* anonymous */ [/home/httpd/wware/node_modules/cheerio/node_modules/dom-serializer/index.js:~101] [pc=0x278c0b62ba4d] (this=0x145473f...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
./compfile.sh: line 100: 2714 Aborted node --stack-size=32000 /home/httpd/wware/tool.js tplcompiler $1
文件/home/httpd/data/fs/tpl/product.com/script/a/yhxq.html的嵌套内容过多,这将导致内存消耗剧增,当前物理内存不足,将使用磁盘做缓冲重新编译,这会导致编译耗时成倍增加。为了避免此情况,请使用view或者扩展内容改造来降低内存消耗。详细操作手册,请查看http://www.wware.org/wide/release.html。
切换使用磁盘缓冲来编译文件/home/httpd/data/fs/tpl/product.com/script/a/yhxq.html,这将需要较长时间,请稍候...
页面配置信息如下:
{ fluid: true, noscale: true, theme: 'sitefuse', title: '用户详情页面' }

<--- Last few GCs --->

474630 ms: Scavenge 2045.3 (2077.1) -> 2045.3 (2077.1) MB, 0.7 / 0 ms (+ 2.3 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
476040 ms: Mark-sweep 2045.3 (2077.1) -> 2045.3 (2077.1) MB, 1409.7 / 0 ms (+ 3.4 ms in 2 steps since start of marking, biggest step 2.3 ms) [last resort gc].
477449 ms: Mark-sweep 2045.3 (2077.1) -> 2045.3 (2077.1) MB, 1409.0 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x2ec48e37399 
2: /* anonymous */ [/home/httpd/wware/node_modules/cheerio/node_modules/dom-serializer/index.js:~101] [pc=0x34f397580f5] (this=0x2ec48eb7909 ,dom=0x276748e474b9 ,opts=0x389bdb128739 )
3: /* anonymous */ [/home/httpd/wware/node_modules/cheerio/node_modules/dom-serializer/index.js:~101] [pc=0x34f3975834d] (this=0x2ec48eb7909...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
./compfile.sh: line 109: 2848 Aborted node --stack-size=32000 --max_old_space_size=2048 --optimize_for_size --max_executable_size=4096 /home/httpd/wware/tool.js tplcompiler $1
文件/home/httpd/data/fs/tpl/product.com/script/a/yhxq.html编译失败,退出本文件的编译处理。请检查上面的输出。如果无法处理,请将您的页面导出,发送给bug@spolo.org。

解决方法有以下三种:

1. 将内容拆分成多个view分别发布之后引用

将这个页面上的内容划分为多个区域,分别复制进view中,发布view之后引入回这个界面即可。

2. 使用扩展内容元素

将页面上较复杂的部分用扩展内容元素代替,把原来的内容放到层中,编辑扩展内容元素的普通属性 data-layername,对应的值即为层的名称,具体操作如下:

2.1 图中蓝色部分表示的是页面中较复杂的部分,点击灰色编辑,将内容全部复制,并清空此部分;

2.2 添加新的层,将刚刚复制的内容粘贴到层中,并将层命名为“h3”如下图:

2.3 在页面中刚清空的部分(即页面中较复杂的部分,也是第一步中蓝色区域的部分)添加扩展内容元素,文档流布局点击“插入”→“扩展内容”如下图:

2.4 修改扩展内容元素属性, data-layername="h3" ,修改后如下图:

3. 临时增加虚拟机内存

3.1 在桌面上找到Oracle VM VirtualBox,双击打开软件,关闭正在运行的虚拟机。

3.2 设置→系统→内存大小,将内存调大至适当值。

3.3 重新启动虚拟机,再次尝试发布。若发布不成功,重复上述步骤继续调大虚拟机内存;若发布成功,为了不影响电脑运行速度建议调整回原来的大小。

(2)发布页面报错,报错内容为“Error can't find module”,并且导出页面在其它wide上可正常发布。

处理办法:强制更新node。注意:需要等到更新结束才可关闭更新页面。