Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set up a node blueimp jquery file upload server on a Joyent cloud SmartOS SmartMachine (nodejs 13.1.0) instance.

It works fine if I manually start it using the command ./node_modules/blueimp-file-upload-node/server.js.

However, if start it using SMF, the server is able to reply to GET and delivering the pics, but cannot accept POST and breaks. Below is the template manifest, client and server error logs. Any help on how I can create the manifest to allow to receive POST much appreciated.

Common error to all manifest at browser POST

Request URL:
Request Headers CAUTION: Provisional headers are shown.
application/json, text/javascript, */*; q=0.01
multipart/form-data; boundary=----WebKitFormBoundary4x1QBIUsPyFwN0xP
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.19 Safari/537.36
 Request Payload
Content-Disposition: form-data; name="send-message"

Content-Disposition: form-data; name="files[]"; filename="84a0ff8ef9ba11e1afba1231380fc0f9_7.jpg"
Content-Type: image/jpeg


The SMF manifests -only what I change after the first one for each case:

SMF manifest as root - no /opt/local/bin/node at exec

<service_bundle type="manifest" name="kamkam">
<service name="site/kamkam-service" type="service" version="1">
<create_default_instance enabled="true"/>
<dependency name="network" grouping="require_all" restart_on="refresh" type="service">
<service_fmri value="svc:/milestone/network:default"/>
<dependency name="filesystem" grouping="require_all" restart_on="refresh" type="service">
<service_fmri value="svc:/system/filesystem/local"/>

<method_context working_directory="/home/projects/egoer/">
<method_credential user="root"/>
  <envvar name="PATH" value="/home/projects/egoer/"/>
  <envvar name="HOME" value="/home/projects/egoer/"/>
  <envvar name="NODE_ENV" value="production"/>



<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="child"/>
<propval name="ignore_error" type="astring" value="core,signal"/>

<property_group name="application" type="application">

<stability value="Evolving"

ERROR WITH ROOT USER NO /opt/local/bin/node at exec

/home/projects/egoer/    node/node_modules/formidable/lib/incoming_form.js:28
  this.uploadDir = opts.uploadDir || os.tmpDir();
TypeError: Object #<Object> has no method 'tmpDir'
at new IncomingForm (/home/projects/egoer/ node/node_modules/formidable/lib/incoming_form.js:28:41)
at [object Object].post (/home/projects/egoer/
at Server.<anonymous> (/home/projects/egoer/
at Server.emit (events.js:67:17)
at HTTPParser.onIncoming (http.js:1124:12)
at HTTPParser.onHeadersComplete (http.js:108:31)
at Socket.ondata (http.js:1019:22)
at Socket._onReadable (net.js:683:27)
at IOWatcher.onReadable [as callback] (net.js:177:10)

SMF manifest as admin- all file privileges

<method_credential user="admin" group="staff" privileges="basic,net_privaddr,file_chown,file_chown_self,file_dac_read,file_dac_search,file_dac_write,file_owner"/>

exec="/opt/local/bin/node /home/projects/egoer/"

ERROR with admin all file privileges

    throw er; // Unhandled 'error' event
Error: EACCES, open '/home/projects/egoer/'
[ Nov 25 15:41:29 Stopping because all processes in service exited. ]

SMF manifest as root using /opt/local/bin/node at exec

<method_credential user="root"/>
exec="/opt/local/bin/node /home/projects/egoer/"

ERROR WITH ROOT USER - using /opt/local/bin/node at exec

    throw er; // Unhandled 'error' event
Error: spawn ENOENT
at errnoException (child_process.js:975:11)
at Process.ChildProcess._handle.onexit (child_process.js:766:34)
 [ Nov 25 16:00:16 Stopping because all processes in service exited. ]
share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.