[SOLVED] [TypeError: Buffer.alloc is not a function] Unable to load plugin meteor

I need some help here. I’m creating a simple app with Meteor Blaze just to fill the gap since when I stopped using it 12 month ago. I’m trying to deploy this app to DO with mup https://github.com/zodern/meteor-up

Runningmup deploy I got this error (I’m no t using Buffer in my app code):

[TypeError: Buffer.alloc is not a function]
Unable to load plugin meteor

Hey, so as far as I understand from this thread this error happens because of old node version.

When I check mup documentation there is this part


So the default docker image has node version sth. like 4.x.x while meteor 1.6 requires node version 8.x.x
So can you check whether your docker image version is the one that matches with meteor 1.6.

Yes it’s correct. I actually just update the node version on my machine like this:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

(which I supposed it shouldn’t matter)

I also run meteor update and it updated just accounts-base
and now the process goes on and stops here:

max@loki:~/src/studio/.deploy$ mup deploy
Building App Bundle Locally

Started TaskList: Pushing Meteor App
[159.89.100.61] - Pushing Meteor App Bundle to the Server
Failed to copy file  { Error: No such file
    at SFTPStream._transform (/usr/local/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2-streams/lib/sftp.js:384:27)
    at SFTPStream.Transform._read (_stream_transform.js:185:10)
    at SFTPStream._read (/usr/local/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2-streams/lib/sftp.js:170:15)
    at SFTPStream.Transform._write (_stream_transform.js:173:12)
    at doWrite (_stream_writable.js:407:12)
    at writeOrBuffer (_stream_writable.js:393:5)
    at SFTPStream.Writable.write (_stream_writable.js:290:11)
    at Channel.ondata (_stream_readable.js:646:20)
    at Channel.emit (events.js:160:13)
    at addChunk (_stream_readable.js:269:12)
    at readableAddChunk (_stream_readable.js:256:11)
    at Channel.Readable.push (_stream_readable.js:213:10)
    at SSH2Stream.<anonymous> (/usr/local/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/Channel.js:140:15)
    at SSH2Stream.emit (events.js:160:13)
    at parsePacket (/usr/local/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2-streams/lib/ssh.js:3163:10)
    at SSH2Stream._transform (/usr/local/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2-streams/lib/ssh.js:551:13) code: 2, lang: '' }

I also tried with 8.9.0 docker image and I got the same problem

Umm. I also found the following issues on github which I think are the same errors. This one and that one

Seems like running mup setup first after any update worked for these guys.

I wish I could help more but it’s been a long time since I ditched MUP :confused:

I re-run mup setup AND I moved to abernix/meteord:node-8.9.3-base because on docker site I found:

Node 8 (Meteor 1.6+)
Node 8.9.3
node-8-base, node-8.9.3-base
node-8-binbuild, node-8.9.3-binbuild
node-8-onbuild, node-8.9.3-onbuild
node-8-devbuild, node-8.9.3-devbuild

mup  deploy
Building App Bundle Locally

Started TaskList: Pushing Meteor App
[159.89.100.61] - Pushing Meteor App Bundle to the Server
[159.89.100.61] - Pushing Meteor App Bundle to the Server: SUCCESS
[159.89.100.61] - Prepare Bundle
[159.89.100.61] - Prepare Bundle: SUCCESS

Started TaskList: Configuring App
[159.89.100.61] - Pushing the Startup Script
[159.89.100.61] - Pushing the Startup Script: SUCCESS
[159.89.100.61] - Sending Environment Variables
[159.89.100.61] - Sending Environment Variables: SUCCESS

Started TaskList: Start Meteor
[159.89.100.61] - Start Meteor
[159.89.100.61] - Start Meteor: SUCCESS
[159.89.100.61] - Verifying Deployment
[159.89.100.61] x Verifying Deployment: FAILED
	
	-----------------------------------STDERR-----------------------------------
	-:--:--     0curl: (7) Failed to connect to localhost port 80: Connection refused
	  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
	                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to localhost port 80: Connection refused
	  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
	                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to localhost port 80: Connection refused
	  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
	                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to localhost port 80: Connection refused
	-----------------------------------STDOUT-----------------------------------
	
	To see more logs type 'mup logs --tail=100'
	

I tried to increase deployCheckWaitTIme but nothing:

    app: {
      ...
      serverOnly: true,
      deployCheckWaitTime: 180,
    },

What does mup logs --tail=100 yield

It’s empty … how can I activate it?

On a different post people suggested to update node on the server. I’ll try that today

We solved the problem. Essentially we are using a DO server with Plesk+nginx installed and to make everything working we needed to change app.env.PORT to an available port on Plesk to make the app communicating internally. Then nginx remap it to port 80.

With this change everything works correctly.

So you cannot use port 80 for internal communication because its in use by Plesk services.

1 Like