Skip to content
This repository

Better handling of EACCES #418

Open
3rd-Eden opened this Issue · 1 comment

2 participants

Arnout Kazemier Julian Duque
Arnout Kazemier
Collaborator

When you try to fetch a snapshot in a folder that you don't have permissions over you will get a rather painful "crash"

tmp  ⚡ jitsu snapshots fetch io                                                                                                                                                       ~/tmp 1 ↵
info:    Welcome to Nodejitsu arnout
info:    jitsu v0.12.0, node v0.8.19
info:    It worked if it ends with Nodejitsu ok
info:    Executing command snapshots fetch io
info:    Listing snapshots for io
data:    name     status   created                 md5
data:    0.0.0    archived 08/15 17:05:01 GMT+0200 84ea46d89347ba19e5e8dcbefa023f5a
data:    0.0.1    archived 11/02 16:10:32 GMT+0100 08c17458b4f1ded473ebc3bca138b3af
data:    0.0.1-1  archived 11/02 16:11:37 GMT+0100 ff3678ac22431a00010e39d813331667
data:    0.0.1-2  archived 11/19 11:47:56 GMT+0100 20f6a1aa46a94339f15fee4beb724f21
data:    0.0.1-3  archived 11/19 11:48:54 GMT+0100 8e3b4281f26dbd387efdfe7f20402c1d
data:    0.0.1-4  archived 11/19 11:50:05 GMT+0100 b29aa7644389b55131ea21fc13854201
data:    0.0.1-5  archived 11/19 11:56:19 GMT+0100 759d6fa5e7ac783555fefd7a57a44f1b
data:    0.0.1-6  archived 11/19 15:41:35 GMT+0100 55c6fd526b3b54ccc94f0eec4c95f9d3
data:    0.0.1-7  archived 11/19 16:17:22 GMT+0100 1a8d272446aa7022c61457d1de0d12b3
data:    0.0.1-8  archived 11/20 16:10:08 GMT+0100 0e95d79e7c5eff962dfee411fc560f06
data:    0.0.1-9  archived 11/20 16:14:54 GMT+0100 67772846a59c682fd2e51a3109737699
data:    0.0.1-10 archived 11/20 16:20:55 GMT+0100 b6969f0e7aae0ebe6f933e19b8ce27c0
data:    0.0.1-11 archived 12/06 15:32:38 GMT+0100 ef84c2b4804040a66c15f02c40f21e9d
data:    0.0.1-12 archived 01/08 13:47:58 GMT+0100 98a0d5ef86f8b714ca21099a7c85fc7e
data:    0.0.1-13 archived 01/08 13:49:17 GMT+0100 7c1349233f068bcab2515876936f5bba
data:    0.0.1-14 archived 01/08 13:58:50 GMT+0100 6a4f26b84e78bcb15a38d805ee898ab9
data:    0.0.1-15 archived 01/08 13:59:50 GMT+0100 ca37488cd47f7c6e5af987eb56e6901c
data:    0.0.1-16 archived 01/08 14:00:54 GMT+0100 b1243297e57aef5b78a892f4073e2766
data:    0.0.1-17 archived 01/08 14:02:25 GMT+0100 f4c8ad2da72ef8210904dcd87ab5adda
data:    0.0.1-18 archived 01/08 14:07:33 GMT+0100 856823ec38fd1eb73823afeac4ca3f79
data:    0.0.1-19 active   01/08 16:10:31 GMT+0100 68ca7ff91d7309f21b9af3cc041dd5e1
prompt: Snapshot Name:  0.0.1-18

stream.js:81
      throw er; // Unhandled stream error in pipe.
            ^
Error: EACCES, open 'io-0.0.1-18.tgz'

Instead of crashing the node process, we should just tell the users that we don't have enough privileges to write in the folder. This check should probably be done before we fetch data from the server. Alternatively we could also ask the user to supply us with a directory that we do have permission over.

Julian Duque
Collaborator

This is related to #380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.