【问题标题】:How do I connect Superdesk with Superdesk Web Publisher?如何将 Superdesk 与 Superdesk Web Publisher 连接?
【发布时间】:2016-12-09 12:48:07
【问题描述】:

当尝试将内容从 SD 发布/推送到 SWP 时,我在 SWP 日志中收到此错误:

[2016-12-07 14:04:56] request.INFO: Matched route
"swp_api_content_push".
{"route":"swp_api_content_push","route_parameters":{"version":"v1","_controller":"SWP\\Bundle\\ContentBundle\\Controller\\ContentPushController::pushContentAction","_route":"swp_api_content_push"},"request_uri":"http://wps.dev/api/v1/content/push","method":"POST"}
[]
[2016-12-07 14:04:56] request.CRITICAL: Uncaught PHP Exception
Doctrine\DBAL\Exception\DriverException: "An exception occurred while
executing 'SELECT t0.host AS host_1, t0.schemes AS schemes_2,
t0.methods AS methods_3, t0.defaults AS defaults_4, t0.requirements AS
requirements_5, t0.options AS options_6, t0.condition_expr AS
condition_expr_7, t0.variable_pattern AS variable_pattern_8,
t0.staticPrefix AS staticprefix_9, t0.id AS id_10, t0.template_name AS
template_name_11, t0.articles_template_name AS
articles_template_name_12, t0.type AS type_13,
t0.cache_time_in_seconds AS cache_time_in_seconds_14, t0.name AS
name_15, t0.position AS position_16, t0.lft AS lft_17, t0.rgt AS
rgt_18, t0.level AS level_19, t0.tenant_code AS tenant_code_20,
t0.root_id AS root_id_21, t0.parent_id AS parent_id_22,
t0.route_content_id AS route_content_id_23 FROM swp_route t0 WHERE
t0.id = ? AND ((t0.tenant_code = '123abc')) LIMIT 1' with params
["articles\/features"]:  SQLSTATE[22P02]: Invalid text representation:
7 ERROR:  invalid input syntax for integer: "articles/features"" at
/home/bsarlo/code/web-publisher/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php
line 91 {"exception":"[object]
(Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception
occurred while executing 'SELECT t0.host AS host_1, t0.schemes AS
schemes_2, t0.methods AS methods_3, t0.defaults AS defaults_4,
t0.requirements AS requirements_5, t0.options AS options_6,
t0.condition_expr AS condition_expr_7, t0.variable_pattern AS
variable_pattern_8, t0.staticPrefix AS staticprefix_9, t0.id AS id_10,
t0.template_name AS template_name_11, t0.articles_template_name AS
articles_template_name_12, t0.type AS type_13,
t0.cache_time_in_seconds AS cache_time_in_seconds_14, t0.name AS
name_15, t0.position AS position_16, t0.lft AS lft_17, t0.rgt AS
rgt_18, t0.level AS level_19, t0.tenant_code AS tenant_code_20,
t0.root_id AS root_id_21, t0.parent_id AS parent_id_22,
t0.route_content_id AS route_content_id_23 FROM swp_route t0 WHERE
t0.id = ? AND ((t0.tenant_code = '123abc')) LIMIT 1' with params
[\"articles\\/features\"]:\n\nSQLSTATE[22P02]: Invalid text
representation: 7 ERROR:  invalid input syntax for integer:
\"articles/features\" at
/home/bsarlo/code/web-publisher/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php:91,
Doctrine\\DBAL\\Driver\\PDOException(code: 22P02): SQLSTATE[22P02]:
Invalid text representation: 7 ERROR:  invalid input syntax for
integer: \"articles/features\" at
/home/bsarlo/code/web-publisher/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:93,
PDOException(code: 22P02): SQLSTATE[22P02]: Invalid text
representation: 7 ERROR:  invalid input syntax for integer:
\"articles/features\" at
/home/bsarlo/code/web-publisher/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91)"}
[]

SD Publish Queue 中的消息是:

PublishHTTPPushServerError Error 14002 - HTTP push publish server error:Error pushing item 500: {"code":500,"message":"Internal Server Error"}  

什么“文本表示”是预期的,我应该在哪里改变它?

谢谢。

【问题讨论】:

  • 之前没有异常?
  • 我清除了日志并进行了发布(重试),这就是我在日志中的全部内容。我正在与 superdesk 发布者分支合作。
  • 但问题是您拥有 Superdesk Publisher(PHP 应用程序)的哪个版本。它是最新发布的 0.1.0?还是主分支?

标签: superdesk


【解决方案1】:

此问题与分配给规则的路由名称错误有关。

这个PR已经修复了。

手动修复:

要修复它,请从 0.1 branch 中提取最新更改。

然后打开src/SWP/Bundle/FixturesBundle/Resources/fixtures/ORM/dev/rule.yml文件并将内容替换为:

SWP\Bundle\CoreBundle\Model\Rule:
    rule1:
        tenantCode: "123abc"
        priority: 1
        configuration:
            route: "<getRouteByName('politics')->getId()>"
            published: true
        expression: 'article.getLocale() matches "/en/"'

保存更改,然后再次加载固定装置:php app/console doctrine:fixtures:load。

注意,它会清除您的数据库数据。

或者您可以直接在数据库中更改该规则的配置,方法是将该行(swp_rule 表)中的配置列替换为,例如:

a:1:{s:9:"published";s:4:"true";}

在这种情况下,4 是politics 路由的 id。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-06-19
  • 2018-05-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-04-30
  • 2016-07-07
相关资源
最近更新 更多