0

I've installed the app on Debian Wheezy with Apache and it is running just fine. I have trouble with uploading files however.

I want to mention, that previously I had this very same app running on a hosting service that provided Node+Passenger option. I am pretty sure we experienced the same issue. I reported it to customer service and they fixed it day after. Unfortunately without explaining what was causing the error. Obviously it works just fine hosted locally, no errors on Nodejitsu hosting as well.

So, my app use this module for handling file uploads: https://www.npmjs.com/package/blueimp-file-upload-expressjs

The logs:

App 32309 stdout: EACCES, open '/var/passenger_node_test/data/uploaded/tmp/upload_b71d67685c771daa8dfabf8630f688f2'

App 32309 stdout: Error: EACCES, open '/var/passenger_node_test/data/uploaded/tmp/upload_b71d67685c771daa8dfabf8630f688f2'

App 32309 stdout:

App 32309 stdout: cleaning

App 32309 stdout: cleaning

[ 2015-01-24 20:53:01.0740 32234/b5fa2b70 EventedBufferedInput.h:146 ]: [EventedBufferedInput 0x84005dc fd=28, state=LIVE, buffer(0)="", paused=0, socketPaused=0, nextTickInstalled=0, generation=2, error=0] onReadable

[ 2015-01-24 20:53:01.0741 32234/b5fa2b70 EventedBufferedInput.h:172 ]: [EventedBufferedInput 0x84005dc fd=28, state=LIVE, buffer(0)="", paused=0, socketPaused=0, nextTickInstalled=0, generation=2, error=0] end of stream

[ 2015-01-24 20:53:01.0741 32234/b5fa2b70 agents/HelperAgent/RequestHandler.h:1223 ]: [Client 25] Event: onAppInputData

[ 2015-01-24 20:53:01.0741 32234/b5fa2b70 agents/HelperAgent/RequestHandler.h:1313 ]: [Client 25] Event: onAppInputEof

[ 2015-01-24 20:53:01.0742 32234/b5fa2b70 agents/HelperAgent/RequestHandler.h:1323 ]: [Client 25] Application sent EOF

[ 2015-01-24 20:53:01.0742 32234/b5fa2b70 Pool2/Implementation.cpp:583 ]: Session closed for process (pid=32309, group=/var/passenger_node_test#default)

[ 2015-01-24 20:53:01.0742 32234/b5fa2b70 agents/HelperAgent/RequestHandler.h:1406 ]: [Client 25] Event: onClientOutputPipeEnd

[ 2015-01-24 20:53:01.0742 32234/b5fa2b70 agents/HelperAgent/RequestHandler.h:1411 ]: [Client 25] Client output pipe ended; disconnecting client

What I think happens. Server received file and saved it as temporary data but for some reason couldn't read it just after. What might cause this error? I tried to run chown -R root on app folder but it didn't help.

Please help, regards

Konrad

youbetternot
  • 2,566
  • 2
  • 17
  • 20
  • Couple of things. 1. Can you check access to `data/uploaded/tmp` folder? 2. Can you check if the said files are uploaded to `data/uploaded/tmp`? – Arvind Jan 25 '15 at 16:30
  • @Arvind tmp folder is: drwxr-xr-x 2 root root 4096 gru 1 18:31 tmp /// there is no files in tmp folder, they or never got saved at all or have been removed (maybe App 32309 stdout: cleaning, i dont know) – youbetternot Jan 25 '15 at 16:36
  • @Arvind Can it be Apache issue? – youbetternot Jan 25 '15 at 16:43
  • Probably, I have not tested the module with Node+Passenger. Also, can you try deleting the upload folders on the server and manually replicate the same structure? may be that would fix a few permission issues. – Arvind Jan 25 '15 at 16:53
  • @Arvind i've removed uploaded folder and created it (and subfolders), didn't help – youbetternot Jan 25 '15 at 17:06
  • ill try to run it without Apache (passenger standalone) – youbetternot Jan 25 '15 at 17:08
  • @Arvind it worked standalone! Its apache, I am not a server guy, what it might be? – youbetternot Jan 25 '15 at 17:10
  • @Arvind I found this http://stackoverflow.com/questions/8854725/rails-3-getting-errnoeacces-permission-denied-when-uploading-files-on-product and I set chmod to 777, issue is gone but I dont like it :) Thanks for your help! – youbetternot Jan 25 '15 at 17:18
  • No issues. Glad it worked out! – Arvind Jan 25 '15 at 17:23

1 Answers1

0

if any one is facing problem to upload images or file to Linux or centos machine , please use this command to give permission to folder to read and write operation : - for example :-

chmod -R 777 /var/www/pack/images

After adding permission you can read and write images.

Abhishek
  • 11
  • 1