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

Own uploaded user avatar image throws a 500 Internal Server Error #1301

Closed
qsnapper opened this issue Dec 28, 2017 · 5 comments
Closed

Own uploaded user avatar image throws a 500 Internal Server Error #1301

qsnapper opened this issue Dec 28, 2017 · 5 comments

Comments

@qsnapper
Copy link

Summary
When uploading an own avatar for a user though the Admin, the uploaded image file throws an Internal Server Error when trying to load the image at its saved URL.

How to replicate
On a standard install of "Grav core + Admin plugin", I used version 1.3.10, try to upload a new jpg image of to your user profile though the admin.

Currently
The image uploads, gets added to the use account yaml file with the correct path, and get stored in the '/user/accounts/avatars/' folder with a changed filename. However the image does not load in the profile.
If you try to load the image directly in the browser it throws a 500 Internal Server Error.

Expected
Image loads normally

Comments

  • Using Windows Server 2016 with IIS
  • Tried downloading the image from the server directly and the image file is fine
  • Tried moving the uploaded image from the '/user/accounts/avatars/' folder to '/images/' (since images uploaded to page where working fine), and trying to load it from the server and it loads fine from there.
@rhukster
Copy link
Member

rhukster commented Jan 4, 2018

A 500 error means something the server returned. You need to look in your logs to see exactly what the message was. It could be a missing library, or even a limit on the upload size, but it's at the IIS level, so that's where the logs containing the relevant information will be.

@qsnapper
Copy link
Author

qsnapper commented Jan 5, 2018

Detailed error message:

HTTP Error 500.50 - URL Rewrite Module Error.
The page cannot be displayed because an internal server error has occurred.

Detailed Error Information:

Module RewriteModule
Notification BeginRequest
Handler StaticFile
Error Code 0x80070005
Requested URL http://www.xxx.com:80/user/accounts/avatars/b50TIYkyAuorxPN.png
Physical Path C:\inetpub\websites\xxx.com\user\accounts\avatars\b50TIYkyAuorxPN.png
Logon Method Not yet determined
Logon User Not yet determined

Using an unmodified 'web.config' file from the 'webserver-configs' being:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <remove value="index.php" />
                <add value="index.php" />
            </files>
        </defaultDocument>
        <rewrite>
            <rules>
                <rule name="request_filename" stopProcessing="true">
                    <match url="." ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
                <rule name="user_error_redirect" stopProcessing="true">
                    <match url="^(user)/(.*)\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$" ignoreCase="false" />
                    <action type="Redirect" url="error" redirectType="Permanent" />
                </rule>
                <rule name="ignore_folders" stopProcessing="true">
                    <match url="^(\.git|cache|bin|logs|backup|webserver-configs|tests)/(.*)" ignoreCase="false" />
                    <action type="Redirect" url="error" redirectType="Permanent" />
                </rule>
                <rule name="system" stopProcessing="true">
                    <match url="^system/(.*)\.(txt|md|html|yaml|yml|php|twig|sh|bat)$" ignoreCase="false" />
                    <action type="Redirect" url="error" redirectType="Permanent" />
                </rule>
                <rule name="vendor" stopProcessing="true">
                    <match url="^vendor/(.*)\.(txt|md|html|yaml|yml|php|twig|sh|bat)$" ignoreCase="false" />
                    <action type="Redirect" url="error" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
    <system.web>
        <httpRuntime requestPathInvalidCharacters="&lt;,&gt;,*,%,&amp;,\,?" />
    </system.web>
</configuration>

@garytube
Copy link

garytube commented Jan 9, 2018

just installed a fresh copy of GRAV (git version) + admin

when uploading a avatar i get a error popup
Invalid argument supplied for foreach()

@garytube
Copy link

garytube commented Jan 9, 2018

..... httpdocs/admin/user: filemng failed: filemng: stat failed: No such file or directory System error 2: No such file or directory

I created admin/user/ myself

Unable to find the file ..httpdocs/admin/user/gary.json at the specified location

karfau pushed a commit to karfau/grav-plugin-admin that referenced this issue Feb 13, 2018
@mahagr mahagr closed this as completed Dec 2, 2020
@boostnest
Copy link

I'm getting this on the unraid install

Copy from Logs:
2022-09-09T07:44:41.237358444+12:00: ERROR ▶ v1/UploadAvatar 3ac open files/3: permission denied

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