Superdesk connection
  • Hello everyone. First of all I'd like to thank Sourcefabric for this tools, just what we need to keep up to date in this news world :)

    I work for a newspaper and we are implementing Superdesk to our workflow. Right now I'm looking forward to test WebPublisher. I'm stuck with the connection between both, here is what I've gone through.

    I have both services running, wps.dev and superdesk.dev, and they work fine. I'm running the branch "publisher" of superdesk-client-core

    I added a subscriber to SD with this settings:

    • Target type: all
    • Media type: Media
    • Targetable by users: true
    • Added a destination:
    • Name: wps.dev
    • Format: ninjs
    • Delivery type: HTTP Push
    • Resource: http://wps.dev/api/v1/content/push

    I've gone through this steps following authentication documentation:
    • Create a user at WP (not in doc but I needed it): php app/console fos:user:create
    • Create tenant for that user (need to add user code): php app/console swp:tenant:create codigo_de_organizacion
    • Then got the token as per documentation
    • Get superdesk auth token and session id: honcho run python3 manage.py users:get_auth_token -uadmin -psuperdesk
    • I had some trouble with curl and SSL and this is what I did to get through:
    • openssl s_client -showcerts -connect superdesk.dev:443 > cacert.pem
    • curl --cacert cacert.pem 'http://wps.dev/api/v1/auth/superdesk' ... rest of the request as per doc
    Then I guess some magic went on in the background

    I was not able to creat a WP Manager (http://superdesk.dev/#/web_publisher/manager)

    Now, with all this set up, I went to publish some article. This is the error in the publish queue:

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

    And this is the error in WebPublisher logs:

    [2016-12-06 11:12:46] 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-06 11:12:46] swp_validators.ERROR: "" The property - firstcreated - is not defined and the definition does not allow additional properties [] []
    [2016-12-06 11:12:46] request.CRITICAL: Uncaught PHP Exception SWP\Component\Bridge\Exception\TransformationFailedException: "None of the chained validators were able to validate the data!" at /home/bsarlo/code/web-publisher/src/SWP/Component/Bridge/Transformer/JsonToPackageTransformer.php line 55 {"exception":"[object] (SWP\\Component\\Bridge\\Exception\\TransformationFailedException(code: 0): None of the chained validators were able to validate the data! at /home/bsarlo/code/web-publisher/src/SWP/Component/Bridge/Transformer/JsonToPackageTransformer.php:55)"} []

    So I got stuck here, any help would be much appreciated.

    Thanks!

    Post edited by Bruno Sarlo at 2016-12-06 09:24:02
  • 9 Comments sorted by
  • I now realize what I have to follow this guide: http://superdesk-web-publisher.readthedocs.io/en/latest/bundles/SWPBridgeBundle/installation.html

    Last time I tried to install the bundle the process never ended and hang out the server. So far seems to be going the same way.

    ~/code/web-publisher$ composer require swp/bridge-bundle
    Using version ^0.1.0 for swp/bridge-bundle           
    ./composer.json has been updated
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    ...

    The script stays there.

    Any recommendation on this?
  • The installation problem was about RAM, 2GB was enough. :)
  • Vote Up0Vote Down Paweł MikołajczukPaweł Mikołajczuk
    Posts: 72Member, Sourcefabric Team
    Hey, first - composer needs a lot of memory (2GB is also required by Superdesk). Read more here: https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors.

    About `swp/bridge-bundle` instalation - manual instalation is not required - it's already included and configured in main application. 

    Your publishing (from superdesk to publisher) error is quite clear and visible in error log:

    [2016-12-06 11:12:46] swp_validators.ERROR: "" The property - firstcreated - is not defined and the definition does not allow additional properties [] []

    It means that incoming package/item json have more fields than allowed - we will check it with Superdesk team. Fo now You can hot fix by adding this:


    "firstcreated" : {
    "description" : "The date and time when first version of the news object was created",
    "type" : "string",
    "format" : "date-time"
    },
    to `src/SWP/Component/Bridge/Validator/NinjsValidator.php` file (section properties, after `versioncreated`). 
  • Vote Up0Vote Down Paweł MikołajczukPaweł Mikołajczuk
    Posts: 72Member, Sourcefabric Team
    Hey, looks like issue with `firstrceated` was fixed already: https://github.com/superdesk/web-publisher/pull/192/files 

    it's included in v0.1.0 release - https://github.com/superdesk/web-publisher/releases/tag/v0.1.0 (please use released versions for testing). 
  • I need help with how to install and use WebPublisher, and also a tutorial of the tool's potentiality
  • Vote Up0Vote Down Paweł MikołajczukPaweł Mikołajczuk
    Posts: 72Member, Sourcefabric Team
    @Pedro -  please don't spam existing topics with your questions not connected to it. 
  • Paweł 
    I did not understand your answer.

    I ask myself how do I connect Web Publisher with Superdesk. I just ask you to indicate some link where I can see and study this approach
  • Poderia por favor me enviar um link para instalar a web publish updated .. porque aqueles que estão no site .. está enfrentando muitos problemas e não instalar ...

    Você poderia me enviar um link atualizado?
    Muito obrigado antecipadamente
  • Could you please send me a link to install the web publish updated .. because those who are on the site .. is experiencing many problems and does not install ...

    Could you send me an updated link?
    Thank you very much in advance