Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local media upload needs to manually create folders (breaking on Windows) #228

Closed
DaveAuld opened this issue Sep 6, 2014 · 18 comments
Closed
Assignees

Comments

@DaveAuld
Copy link

DaveAuld commented Sep 6, 2014

I tried creating a new article this morning and attempted to upload new image (from media tab). However, it isn't working.

I came out of the article editor, went to the main Media Manager and attempted to upload the images from there, again didn't work.

The console output is throwing out the following error;
{"level":"error","message":"RequestHandler: An error occurred during controller execution. URL=[POST:/actions/admin/content/media/upload_media] ROUTE={"path":"actions/admin/content/media/upload_media","pattern":"^/actions/admin/content/media/upload_media[/]{0,1}$","path_vars":{},"expression":{},"themes":{"pencilblue":{"POST":{"method":"POST","path":"/actions/admin/content/media/upload_media","access_level":1,"auth_required":true,"content_type":"text/html"}}}}\nError: ENOENT, open 'C:\Users\Administrator\desktop\node_projects\pb-dma\public\media\2014\9\540ae62ebc6b451825000010-1410000430988.jpg'","timestamp":"2014-09-06T10:47:10.988Z"}

Any ideas?

@blakecallens
Copy link
Member

Try pulling the latest version of master. There was an upload bug that @brianhyder fixed late last week.

@blakecallens
Copy link
Member

Confirmed media upload is working when running the latest version (although I'm on Linux, so the possibility remains that it's a Windows issue).

@DaveAuld
Copy link
Author

DaveAuld commented Sep 6, 2014

Just done a git pull and it picked up the 2 latest changes from today (I have been pretty much picking up each change as they occur), pencilblue restarted ok, but still no joy.

hmmm....

@blakecallens
Copy link
Member

Ok, I'm going to assign this to @brianhyder, since he's been working on some media upload changes. He has a windows machine too.

@DaveAuld
Copy link
Author

DaveAuld commented Sep 6, 2014

Running with the dev console open in chrome, the moment you select the image file to open and click the 'open' button in the file browser dialog the console spits out;

image

@blakecallens
Copy link
Member

That's consistent with the upload_media controller breaking with the error you showed from the server console.

On that, an ENOENT error means that the server can't access a file location. I've confirmed that the system is correctly creating the folder structure. Maybe your install of PencilBlue doesn't have write permissions.

@DaveAuld
Copy link
Author

DaveAuld commented Sep 6, 2014

Ok, got somewhere;

Pencillblue is running in An Administrator powershell console.
Administrator rights are assigned to the folders as defalult and all look ok across the pencilblue structure.
Pencilblue is happily writing to the log file in the log directory.

Pencilblue is trying to write to the folder media/2014/9/, this folder does not exist. The folder media/2014/8/ does exist from when I previously uploaded media.

Manually creating the folder media/2014/9/ and then re-trying to upload the image and it works!

So....pencilblue is unable to create the folder '9'....but can happily write to the folder if it exists.

???

@blakecallens blakecallens changed the title Media Upload stopped working Local media upload needs to manually create folders (breaking on Windows) Sep 6, 2014
@blakecallens
Copy link
Member

Awesome! Looks like we have a path to a fix!

@brianhyder, media upload will just need to see if the folder path exists and make some directories if it doesn't.

@jahlomp
Copy link
Contributor

jahlomp commented Sep 6, 2014

This is the issues I run into and reported here #203

@blakecallens
Copy link
Member

Yup. This looks like a Windows thing. @jahlomp, for now, do what @DaveAuld did and create the folder for /public/media/2014/9/

We should have a fix in by the end of this weekend.

@jahlomp
Copy link
Contributor

jahlomp commented Sep 6, 2014

ok

@brianhyder
Copy link
Member

Please send me the server side console output with log level set to
"silly". It will output whether or not it created the folders on upload.
On Sep 6, 2014 8:55 AM, "Dave Auld" notifications@github.com wrote:

Ok, got somewhere;

Pencillblue is running in An Administrator powershell console.
Administrator rights are assigned to the folders as defalult and all look
ok across the pencilblue structure.
Pencilblue is happily writing to the log file in the log directory.

Pencilblue is trying to write to the folder media/2014/9/, this file does
not exist. The folder media/2014/8/ does exist from when I previously
uploaded media.

Manually creating the folder media/2014/9/ and then re-trying to upload
the image and it works!

So....pencilblue is unable to create the folder '9'....but can happily
write to the folder if it exists.

???


Reply to this email directly or view it on GitHub
#228 (comment)
.

@brianhyder
Copy link
Member

Is it creating the directory structure for media?
When you change the log level to silly, do you see output on upload that
indicates it is attempting to create the directory structure?
On Sep 6, 2014 7:43 AM, "Blake Callens" notifications@github.com wrote:

Assigned #228 #228 to
@brianhyder https://github.com/brianhyder.


Reply to this email directly or view it on GitHub
#228 (comment).

@brianhyder
Copy link
Member

We were having an issue with media. Can you verify you have the latest on
master? I broke it not that long ago.

Also, look to see that the folder structure was created for the media item.
If it was the then chances are that you don't have the latest code.
On Sep 6, 2014 7:22 AM, "Dave Auld" notifications@github.com wrote:

I tried creating a new article this morning and attempted to upload new
image (from media tab). However, it isn't working.

I came out of the article editor, went to the main Media Manager and
attempted to upload the images from there, again didn't work.

The console output is throwing out the following error;
{"level":"error","message":"RequestHandler: An error occurred during
controller execution. URL=[POST:/actions/admin/content/media/upload_media]
ROUTE={"path":"actions/admin/content/media/upload_media","pattern":"^/actions/admin/content/media/upload_media[/]{0,1}$","path_vars":{},"expression":{},"themes":{"pencilblue":{"POST":{"method":"POST","path":"/actions/admin/content/media/upload_media","access_level":1,"auth_required":true,"content_type":"text/html"}}}}\nError:
ENOENT, open
'C:\Users\Administrator\desktop\node_projects\pb-dma\public\media\2014\9\540ae62ebc6b451825000010-1410000430988.jpg'","timestamp":"2014-09-06T10:47:10.988Z"}

Any ideas?


Reply to this email directly or view it on GitHub
#228.

@brianhyder
Copy link
Member

I reproduced it. Working on a fix.

@brianhyder
Copy link
Member

Pushed up branch issue/PB228. It should fix the windows problem. Need to test on Mac and Linux before merge

brianhyder added a commit that referenced this issue Sep 7, 2014
Fixes #228.  Corrects inability to upload media on windows with FS Media Provider
@AnibalFlores
Copy link

If you try to add a user´s photo BEFORE any media in a fresh pencilblue installation the buttons "Link to image..." and "Upload image..." open dialogs simply don´t work

@jahlomp
Copy link
Contributor

jahlomp commented Jan 18, 2015

Check the browser's console to check if you are getting an angular
photocontroller error or something.

On 15:00, Sun, Jan 18, 2015 Aníbal H. Flores notifications@github.com
wrote:

If you try to add a user´s photo BEFORE any media in a fresh pencilblue
installation the buttons "Link to image..." and "Upload image..." open
dialogs simply don´t work


Reply to this email directly or view it on GitHub
#228 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants