bcgov / smk-cli

The Command Line Interface enables users to rapidly create and edit SMK map configuration, including data consumption via OGC and Esri ReST data access services and local data files.

Home Page:https://bcgov.github.io/smk-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Manage DataBC Layers - not working

franTarkenton opened this issue · comments

To reproduce:

  • create a simple SMK app
  • go to Layers->Manage Data BC Layers

The following is the output from the CLI before it dies:

kjnether@NE080281:~/proj/wrf-airquality/junk/SMK-App$ smk edit
  ()                     _      _ _ _               _   ,      
  /\                    //     ' ) ) )             ' ) /    _/_
 /  )  o ______    _   //  _    / / /  __.    _     /-<   o /  
/__/__<_/ / / <_  /_)_</_ </_  / ' (_ (_/|_  /_)_  /   ) <_<__ 
                 /                          /                  
                '                          '         CLI v1.0.0
Starting service..
Opening default browser at http://localhost:1337...
Endpoints available:
        GET     /       -> ../../node_modules/smk-cli/smk-edit/static
        GET     /assets -> ./assets
        GET     /layers -> ./layers
        GET     /module -> ../../node_modules/smk/dist
        POST    /catalog/asset
        GET     /catalog/asset
        GET     /catalog/asset/:id
        POST    /catalog/local
        GET     /catalog/local
        DELETE  /catalog/local/:id
        PUT     /catalog/local/:id
        GET     /catalog/local/:id
        GET     /catalog/mpcm
        GET     /catalog/mpcm/:id
        GET     /catalog/wms/:url
        GET     /catalog/wms/:url/:id
        POST    /config
        GET     /config
        POST    /convert/csv
        POST    /convert/geojson
        POST    /convert/kml
        POST    /convert/shape
        GET     /ping
Current path is /home/kjnether/proj/wrf-airquality/junk/SMK-App
Base path is ./
Configuration path is ./smk-config.json
Layers catalog path is ./layers
Assets catalog path is ./assets
Temp path is ./.temp
Service listening at http://localhost:1337/
Hit Ctrl-C to exit

2021-08-05T20:27:15.430Z GET /config
    Reading config from /home/kjnether/proj/wrf-airquality/junk/SMK-App/smk-config.json
2021-08-05T20:27:31.875Z GET /catalog/mpcm
    Loading MPCM Catalog from https://apps.gov.bc.ca/pub/mpcm/services/catalog/PROD
undefined:1


SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at IncomingMessage.<anonymous> (/home/kjnether/proj/wrf-airquality/node_modules/smk-cli/smk-edit/controllers/catalogs.js:78:29)
    at IncomingMessage.emit (node:events:381:22)
    at endReadableNT (node:internal/streams/readable:1307:12)
    at processTicksAndRejections (node:internal/process/task_queues:81:21)

Thanks for logging this issue. It looks like you're using v1.0.0 of the smk-cli. This issue should be fixed in v1.0.1. Could you please try updating to v1.0.1 and checking to see if you can access the DataBC Layers?

npm install -g @bcgov/smk-cli@latest

Yep that resolved it! Thanks!