Speckle 2.0 Server build error

ello! I am trying to stand up a speckle 2.0 server and I keep running into build errors. I’ve been following the steps for cloning the server, running npm install, and setting up the .env file at the root. Since I’m very new to Servers, Docker, NPM, and life in general I’ve been trying to docker-compose up and read through the cli to see if there is any errors I can pick up on that make sense. I’ve been able to tackle missing packages and unsynced package-lock files, but I keep hitting a wall when I get to step 18/28 : RUN npm run build.

ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @speckle/frontend@2.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @speckle/frontend@2.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have tried installing/reinstalling @vue-cli-service, but I’m not really sure if I’ve done anything or just randomly pinged someone on twitter…

I’m in the midst of googling for a solution, so I will update this forum if I make any progress. I’m unsure of what info I can supply to help work through this issue, but if there is any request I can do my best to share em’!

1 Like

hai David!

I’m not a docker expert, but quick question: are you looking to deploy a server or just run it locally? If you’re looking to deploy, I’ll ping @AlanRynne as he just did it fresh yesterday and might know about any gotchas that would have caused frontend to fail!

if the latter, it might be easier to not use docker and just start up like this:

  1. build the viewer
cd packages/viewer
npm install
npm run build
  1. link the viewer to the frontend
cd packages/frontend
lerna bootstrap
  1. in both /frontend and /server:
npm run dev
2 Likes

HeyHello Izzy!

at the moment I’m trying to get a local server. I followed the steps you suggested and I seem to be finding a new error once I get to step 3. I tried installing the missing dependencies and walking through the steps again but it sadly lead to the same spot :expressionless:

INFO  Starting development server...
98% after emitting CopyPlugin
ERROR  Failed to compile with 3 errors                                                                                   9:39:26 AM
These dependencies were not found:
    * @speckle/viewer in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader/lib??vue-loader-options!./src/components/Renderer.vue?vue&type=script&lang=js&
    * subscriptions-transport-ws in ./node_modules/apollo-link-ws/lib/bundle.esm.js, ./src/vue-apollo.js

heya!

hmm very weird…I can’t reproduce this but I have a couple of questions:

  1. what node version are you using? we’ve been using v12 so I would stick to that if you’re not on it
  2. have you pulled latest?
  3. was the output of lerna bootstrap in the frontend all good? did it complete successfully?
  4. could you try deleting the node_modules dir and going through the steps again?
1 Like
  1. Node is set to v12.18.4
  2. I just refreshed my repo! (cloned it last week)
  3. The lerna bootstrap part seemed to work. I did use npx lerna bootstrap at first until I installed it globally, then i was using lerna bootstrap. It didn’t create an errors.
  4. Doing the steps again after deleting the nodes_modules dirs, which I deleted in each package dir along with the repo root. This still created the same error at step 3 (im running \frontend npm run dev first).

I think I’m going purge the repo and pull a clean one in and see if I’m getting the same issue.

You can also give it a shot with docker-compose up, if you have docker going already on your machine.

1 Like

Just gave that another shot and came up with the same error as before. I’ve tried manually installing the missing files, but am still getting this error

* subscriptions-transport-ws in ./node_modules/apollo-link-ws/lib/bundle.esm.js, ./src/vue-apollo.js

To install it, you can run: npm install --save subscriptions-transport-ws
 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @speckle/frontend@2.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @speckle/frontend@2.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-02-02T16_26_33_428Z-debug.log
ERROR: Service 'server' failed to build : The command '/bin/sh -c npm run build' returned a non-zero code: 1

okay that looks a bit different; if you do npm install --save subscriptions-transport-ws in the frontend, what happens then?

1 Like

Progress! I was able to get a fully built server, but now I get this connection error. I did see a window pop up to allow docker public access to the computer, so I’m going to try re-running the docker-compose up again and see if i get that same error

server_1         |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
server_1         | [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
server_1         |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)

EDIT: same when re-running the docker command. I found the args passed before the server_1 error start hitting

redis_1          | 1:M 02 Feb 2021 17:11:53.385 * Loading RDB produced by version 6.0.10
redis_1          | 1:M 02 Feb 2021 17:11:53.385 * RDB age 9 seconds
redis_1          | 1:M 02 Feb 2021 17:11:53.385 * RDB memory usage when created 0.77 Mb
redis_1          | 1:M 02 Feb 2021 17:11:53.385 * DB loaded from disk: 0.000 seconds
redis_1          | 1:M 02 Feb 2021 17:11:53.385 * Ready to accept connections
server_1         | 2021-02-02T17:01:08.596Z speckle:db-startup Loaded knex conf for production
server_1         | [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
server_1         |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
server_1         | [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
server_1         |     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)

yay progress!

it looks to me like you don’t have redis running. you need a local instance of both redis and postgres running for the server to startup.

I’m not sure how the dockerfile deals with this tbh so I can’t be much help on that front. but for bootstrapping with lerna and running npm run dev, you need to start both dbs before you run the dev scripts. for postgres, just run psql if you’re on windoze and for redis, run the redis-server.exe if you’re using the outdated windows version we recommend. I wrote up a little bit on how to do this on our new (and very wip) docs at speckle.guide

1 Like

Thank for linking the speckle guide doc, this was really helpful to reference when setting this up. Following the steps I was able to get a fresh local server up and running. I’d still like to get a real server setup for our team in the near future, but for now I can get some progress going with the local server

For peeps who are really new to this process (like myself!) here are a couple steps I made errors at…

  • When setting up postgres I used the pgAdmin tool to setup the database named speckle2_dev and it seemed to create a server instead.
  • I ended up using docker for setting up my redis-server.

I ended up getting caught on an additional error that was regarding the account manager, but I was able to fix that issue when I found the most recent manager

2 Likes

Hey, @haitheredavid
I think your latest try with docker-compose failed due to config issues. Could you share your configration?
I only ran into this error, when the server config values for db connection were wrong.

One more thing, that could be the cause, did you copy your .env file to the project root folder, next to the docker-compose file? Otherwise I think you can use the --project-directory to specify the location of your .env file.

I am able to run the viewer and server successfully but getting error while running frontend. Though lerna bootstrap is successful.

\Speckle\speckle2.0\speckle-server\packages\frontend>lerna bootstrap
info cli using local version of lerna
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 3 packages
lerna info Symlinking packages and binaries
lerna success Bootstrapped 3 packages

\Speckle\speckle2.0\speckle-server\packages\frontend>npm run serve

@speckle/frontend@2.1.0 serve \Speckle\speckle2.0\speckle-server\packages\frontend
vue-cli-service serve

INFO Starting development server…
98% after emitting CopyPlugin

ERROR Failed to compile with 919 errors 11:49:44 AM

These dependencies were not found:

  • core-js/modules/es.array-buffer.constructor in …/viewer/dist/Speckle.js
  • core-js/modules/es.array.concat in ./node_modules/vuetify/lib/components/VCalendar/VCalendarDaily.js, ./node_modules/vuetify/lib/components/VCalendar/VCalendarWeekly.js and 54 others
  • core-js/modules/es.array.every in ./node_modules/vuetify/lib/components/VColorPicker/util/index.js, ./node_modules/vuetify/lib/components/VDataIterator/VDataIterator.js and 3 others
  • core-js/modules/es.array.fill in ./node_modules/vuetify/lib/components/VCalendar/VCalendarCategory.js, ./node_modules/vuetify/lib/components/VDatePicker/VDatePickerMonthTable.js and 3 others
  • core-js/modules/es.array.filter in ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js, ./node_modules/vuetify/lib/components/VAutocomplete/VAutocomplete.js and 26 others
  • core-js/modules/es.array.find in ./node_modules/vuetify/lib/components/VAutocomplete/VAutocomplete.js, ./node_modules/vuetify/lib/components/VCombobox/VCombobox.js and 16 others
  • core-js/modules/es.array.find-index in ./node_modules/vuetify/lib/components/VData/VData.js, ./node_modules/vuetify/lib/components/VDataTable/VDataTable.js and 13 others
  • core-js/modules/es.array.flat in ./node_modules/vuetify/lib/components/VCard/VCard.js, ./node_modules/vuetify/lib/components/VColorPicker/VColorPicker.js and 7 others
  • core-js/modules/es.array.for-each in ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js, ./node_modules/vuetify/lib/framework.js and 19 others
  • core-js/modules/es.array.from in ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js, ./node_modules/@babel/runtime/helpers/iterableToArray.js and 8 others
  • core-js/modules/es.array.includes in ./node_modules/vuetify/lib/framework.js, ./node_modules/vuetify/lib/components/VAlert/VAlert.js and 29 others
  • core-js/modules/es.array.index-of in ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js, ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js and 16 others
  • core-js/modules/es.array.iterator in ./node_modules/@babel/runtime/helpers/typeof.js, ./node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js and 5 others
  • core-js/modules/es.array.join in ./node_modules/vuetify/lib/components/VBreadcrumbs/VBreadcrumbs.js, ./node_modules/vuetify/lib/components/VDataTable/VDataTableHeaderDesktop.js and 9 others
  • core-js/modules/es.array.last-index-of in …/viewer/dist/Speckle.js
  • core-js/modules/es.array.map in ./node_modules/vuetify/lib/components/VAutocomplete/VAutocomplete.js, ./node_modules/v

Hi @dimitrie @izzylys ,
I am able to solve above error, but still I am getting one error. Can you help me to resolve this.

ERROR Failed to compile with 1 errors 11:09:26 AM

This dependency was not found:

  • @speckle/viewer in ./node_modules/cache-loader/dist/cjs.js??ref–12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref–0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Renderer.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save @speckle/viewer
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat ‘C:\DumpStack.log.tmp’
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat ‘C:\hiberfil.sys’
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat ‘C:\pagefile.sys’
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat ‘C:\swapfile.sys’

Hi @Ritesh_Solanke! Seems like when you ran lerna bootstrap on the frontend package, it didn’t properly install the viewer.

Can you ensure you run the build script in the viewer package before running lerna bootstrap in the frontend?

1 Like