Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Screenshot 2019-06-06 16.15.45.png
    Screen Shot 2019-06-06 at 16.20.38.jpg
    Could someone help me to fix it?
    Didier Lafforgue
    hi @shooperis, this is super weird. Could you provide us the server logs please? It looks like the content assets controller responds with a 500. thanks!
    Carlos Virreira
    Hi everyone, I wonder if someone has successfully done a data import from CSV/Excel to Loco? If so, is there any guide or best practice to do so? Thank in advance and sorry if its a bit of a stupid question =)
    Haven't done it yet but were I to I'd use a csv to yaml converter to generate a yaml file. Then (after a quick search/replace to replicate locomotive's yml format) put it in the data folder under an environment folder (say import) and deploy like bundle exec wagon deploy production -d -e import
    Didier Lafforgue
    hi @carlosvirreira_twitter, that’s not a stupid question!
    if you’re a ruby developer, I suggest to use the https://github.com/locomotivecms/coal gem
    it makes your life easier if you have to communicate with the Locomotive API
    in order to read a CSV/Excel file, https://github.com/roo-rb/roo is one of the best libraries
    David Roy
    Has anyone had success getting locomotive 4rc0 or indeed any other version working on AWS DocumentDB?
    Very interesting question indeed since I'm gonna be working soon on a site that's nationwide(fr 😎) and will have to cope with a very heavy load of visits. I haven't decided yet which option to choose between AWS and/or Heroku (or else).
    David Roy
    I have it 'almost' working, I am going to debug a little to find out why it crashes on the site dashboard
    Sadly Heroku is not a option, the company will work with AWS but if I want other suppliers I would need to justify buying up said suppler -_-
    David Roy
    Its made worse for the lack of (or my lack of being able to find) a DocumentDB docker image to test it locally
    David Roy
    So the error seems to be perhaps it isn't finding current_site since it is breaking on anything trying to fetch current_site which is via env.
    No route matches {:action=>"sort", :controller=>"locomotive/pages", :id=>nil, :site_handle=>#<Locomotive::Site _id: 5d641d0ff701500008397a2d, created_at: 2019-08-26 17:55:27 UTC, updated_at: 2019-08-26 17:55:27 UTC, seo_title: nil, meta_keywords: nil, meta_description: nil, handle: "poised-fern-2173", domains: [], redirect_to_first_domain: false, redirect_to_https: false, asset_host: nil, locales: ["en"], prefix_default_locale: false, timezone_name: "UTC", cache_enabled: false, template_version: nil, content_version: nil, url_redirections: [], url_redirections_information: {}, private_access: false, password: nil, metafields: {}, metafields_schema: [], metafields_ui: {}, sections_content: {"en"=>{}}, routes: [], name: "cms-tracks", robots_txt: nil, picture: nil, created_by_id: BSON::ObjectId('5d640eb7f701500008397a2c')>}, possible unmatched constraints: [:id]
    David Roy
    Looks like it is a bust, DocumentDB does not seem to support some of the queries which means locomotive on AWS is all fussy self container and backup management
    David Roy
    I notice we have the default puma config set with no WEB_CONCURRENCY, is this that locomotive needs to run in single mode?
    David Roy
    Did page caching ever make it into the v4 engine?
    Patrick Meunier
    Hi everyone! I am having a problem identifying the source of an issue when I try to deploy with wagon
    ### Error description:
    undefined method `name' for nil:NilClass
    ### Backtrace:
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_coal-1.5.1/lib/locomotive/coal/resources/concerns/request.rb:36:in `do_request'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_coal-1.5.1/lib/locomotive/coal/resources/concerns/request.rb:7:in `get'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_coal-1.5.1/lib/locomotive/coal/resources/current_site.rb:9:in `get'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/lib/locomotive/wagon/commands/push_command.rb:154:in `remote_site'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/lib/locomotive/wagon/commands/push_command.rb:67:in `validate!'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/lib/locomotive/wagon/commands/push_command.rb:50:in `_push'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/lib/locomotive/wagon/commands/push_command.rb:41:in `push'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/lib/locomotive/wagon/commands/push_command.rb:31:in `push'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/lib/locomotive/wagon.rb:73:in `push'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/lib/locomotive/wagon/cli.rb:318:in `deploy'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/gems/locomotivecms_wagon-2.4.1/bin/wagon:12:in `<top (required)>'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/bin/wagon:23:in `load'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/bin/wagon:23:in `<main>'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/bin/ruby_executable_hooks:15:in `eval'
            /Users/patrick/.rvm/gems/ruby-2.4.4@wagon/bin/ruby_executable_hooks:15:in `<main>’
    I’ve been able to deploy to a staging site on the same host, but not on the production site. I looked in my content_types but I am not using “name” anywhere. I’m kinda stuck there. Any ideas?
    Nikolay Bonev
    @infernalsirius can you run the deploy with -v so we can see which is the last file being deployed before the error
    Will Mulligan
    hey guys, am hosting my own v4 engine on AWS - has anyone had any success with using dragonfly gem in conjunction with S3 / Cloudfront? I'm finding that resized image files generated from dragonfly are being saved in the public folder on my app server, rather than on S3. I'm expecting them to be saved to s3.

    my carrierwave.rb

    CarrierWave.configure do |config|
      config.cache_dir = File.join(Rails.root, 'tmp', 'uploads')
      # rather than add ENV Variables to build docker image
      # assume local store for purposes of assets compile
      if ENV['AWS_ACCESS_KEY_ID'].blank?
        # settings for the local filesystem
        config.storage = :file
        config.root = File.join(Rails.root, 'public')
        case Rails.env.to_sym
        # when :development
        #   config.storage = :file
        #   config.root = File.join(Rails.root, 'public')
        when :production, :development
          # WARNING: add the "carrierwave-aws" gem in your Rails app Gemfile.
          # More information here: https://github.com/sorentwo/carrierwave-aws
          # use same envars as SES and other BMS projects
          config.storage          = :aws
          config.aws_bucket       = ENV['AWS_S3_BUCKET']
          config.aws_acl          = 'public-read'
          config.aws_credentials  = {
            access_key_id:      ENV['AWS_ACCESS_KEY_ID'],
            secret_access_key:  ENV['AWS_SECRET_ACCESS_KEY'],
            region:             ENV['AWS_REGION']
          # Put your CDN host below instead
          if ENV['S3_ASSET_HOST_URL'].present?
            config.asset_host = ENV['S3_ASSET_HOST_URL']
          # settings for the local filesystem
          config.storage = :file
          config.root = File.join(Rails.root, 'public')

    and my dragonfly.rb

    # Configure
    Dragonfly.app(:engine).configure do
      plugin :imagemagick,
        convert_command:  `which convert`.strip.presence || '/usr/local/bin/convert',
        identify_command: `which identify`.strip.presence || '/usr/local/bin/identify'
      verify_urls true
      secret '81a8ec3b0f9d2520f2d5bd0745bfb2bc74885b65f246a1b3c73a8ea134d0e85f'
      url_format '/images/dynamic/:job/:sha/:basename.:ext'
      fetch_file_whitelist /public/
      fetch_url_whitelist /.+/
      url_host "https://#{ENV['S3_ASSET_HOST_URL']}" if ENV['S3_ASSET_HOST_URL']
    # Logger
    Dragonfly.logger = Rails.logger
    # Mount as middleware
    Rails.application.middleware.use Dragonfly::Middleware, :engine
    can confirm that my ENV's are all correct, and that my normal theme asset's etc are being saved to s3 and fetched via cdn correctly... it's just the dragonfly stuff...
    Patrick Meunier
    @DonKoko This is the verbose stack trace… I’ve been able to pinpoint the issue with the content_types but issue seems to be on the engine side.
    Patrick Meunier
    @DonKoko Here is the log from the engine:
    E, [2019-09-28T13:52:51.555995 #7109] ERROR -- : [950ff36c-6612-4af5-b8cd-dd8a6e17f939] [API] undefined methodname’ for nil:NilClass
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/bundler/gems/engine-a4704dbc21f9/app/api/locomotive/api/entities/membership_entity.rb:15:in block in <class:MembershipEntity>' 
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:496:in exec_with_object' 
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:82:in valid_value' 
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:41:in block in serializable_value' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:120:inblock (2 levels) in map_entity_exposures’
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:116:in block in with_attr_path' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/options.rb:90:inwith_attr_path’
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:115:in with_attr_path' 
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:119:inblock in map_entity_exposures’
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in each' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:ineach_with_object'
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in map_entity_exposures' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:40:inserializable_value’
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:489:in serializable_hash' 
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:71:in serializable_value' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:41:inblock in serializable_value'
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:120:in block (2 levels) in map_entity_exposures' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:116:inblock in with_attr_path'
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/options.rb:90:in with_attr_path' 
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:119:in block in map_entity_exposures' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:ineach’
    /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in each_with_object' /usr/local/rvm/gems/ruby-2.4.4@locomotiveapp/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:inmap_entity_exposures’
    Nikolay Bonev
    @infernalsirius can you share with us how your file looks for the content_type that is crashing
    should be something in that file
    Will Mulligan
    Hey guys, I'm still trying to figure out the correct configuration for using Dragonfly image resizing in conjunction with a CDN (.
    If anyone has successfully set that up on their Engine app, I would love to know how you did it! :)
    Benoit Molenda
    I'm getting a look at sections and I have simple question.
    I used the generator, and in the liquid file, the YML is instead JSON.
    The doc provide both JSON and YML exemples.
    Is there a way to tell the generator to generate YML instead ?
    Is there a reason for this change ?
    Didier Lafforgue
    hi @proxygear, after being a little bit away from Locomotive, I’m preparing a new release of Wagon which will include the YML section generators
    why moving to YML?
    well, I’ve been using sections for our projects for more than a year now and switching to YAML was a relief to me
    it’s so easier to read YML than JSON
    Benoit Molenda
    Sorry, your answer is confusing :p let me rephrase ...
    I just used the generator command bundle exec wagon generate section test
    In the liquid file header, there is JSON.
    Until now, there was YML in my previous liquid files.
    So my question was : Do you plan to move locomotive header files to JSON ?
    YML is more readable for me than JSON as well ^^
    Cadel Jones

    Hello guys,
    Cadel Jones here. I work as a developer for Colibri Software and was wondering if you could answer a question I had.

    We are currently using locomotive for one of our inventory focused websites. We created a Vue frontend that calls the CMS api to get products and categories etc. I know that the endpoints are paginated. Is there any way to sort the results? Maybe by price or by category?

    I was looking around and found some info about filtering products when using the coal client.
    But we are looking to sort not filter. and we are hitting the api via url in our Vue app.

    Nikolay Bonev
    did you check the actual API?
    you have :where & order_by
    maybe that is what you need
    Cadel Jones
    Thank you, that looks like a helpful start.
    Nikolay Bonev
    @cadeljones_gitlab glad i could help. Never used this one specifically but now you know where to look and what to test :)
    Benoit Molenda
    Hello guys, I ran through an issue updating to the V4.
    The cause was the assets. I had to clean it up manually.
    There is no "update to V4" page on the doc.
    Do you know how I can add an extra page for "update to V4" ?
    Didier Lafforgue
    hi @proxygear
    there should be no need to run an upgrade script to v4