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

Uploading Files duplicates IP/URL #9970

Closed
killeluke opened this issue Aug 23, 2021 · 5 comments
Closed

Uploading Files duplicates IP/URL #9970

killeluke opened this issue Aug 23, 2021 · 5 comments

Comments

@killeluke
Copy link

I recently moved the server and imported/exported data fine.
When I upload images (and current images in the db) it adds the URL again:
http://10.0.0.101/companies/10.0.0.101/uploads/assets/asset-image-Ve6fQN6xaC.PNG
Unsure why its adding the http://10.0.0.101/companies part. This happens with new uploads and the ones already in there.

Also getting 500 error when adding the logo back but think it may be looking in the wrong directory as above.

Please confirm you have done the following before posting your bug report:

  • [N] I have enabled debug mode - I have checked ENV file but no errors are thrown, its looking in a wrong directory
  • [Y] I have read checked the Common Issues page

Provide answers to these questions:

  • Is this a fresh install or an upgrade? Fresh & Move
  • Version of Snipe-IT you're running Version v5.1.8 - build 6227 (master)
  • Version of PHP you're running 7.4.3
  • Version of MySQL/MariaDB you're running 15.1 Distrib 10.3.31-MariaDB, for debian-linux-gnu
  • What OS and web server you're running Snipe-IT on Ubuntu 20.04.2
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Manual
  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
  • Include any additional information you can find in storage/logs and your webserver's logs.
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

https://snipe-it.readme.io/docs/getting-help

@welcome
Copy link

welcome bot commented Aug 23, 2021

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@killeluke killeluke changed the title Uploading Files duplicates IP/URLhttps://archive-eu.titanhq.com/titan/jkco Uploading Files duplicates IP/URL Aug 23, 2021
@snipe
Copy link
Owner

snipe commented Aug 23, 2021

I'd probably check your APP_URL and make sure your app caches are clear. https://snipe-it.readme.io/docs/common-issues#quick-tip-handy-commands

The app itself has no way to "remember" IPs or URLs, so it's got to be cached or incorrect somewhere in your config.

Snipe-IT Documentation
These commands should be run from your Snipe-IT project root, just like every other cli command we mention. They should not need to be run as root/sudo/admin.Or to run them as a one-liner all at once:These commands clear out cached service files that help speed up modern PHP applications but can a...

@killeluke
Copy link
Author

I ran your cache clearing and looked for the files to delete (they weren't there) restarted service and it didn't do anything.

From what you said though I thought mmm what if I delete the IP from APP_URL and this fixed the duplicate issue and images now work.

APP_URL=
APP_TIMEZONE='Europe/London'

Rebooted the server too and still working, so win?

Logo doesn't load and still throws a 500 error though, enabled debugging, hope this is what you need? Just pressed copy:

Illuminate\Database\QueryException thrown with message "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'allow_user_skin' in 'field list' (SQL: update settings set logo = setting-logo-bLKphQGERQ.jpg, allow_user_skin = ?, settings.updated_at = 2021-08-24 14:38:07 where id = 1)"

Stacktrace:
#71 Illuminate\Database\QueryException in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
#70 Doctrine\DBAL\Driver\PDO\Exception in /var/www/snipe-it/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
#69 Doctrine\DBAL\Driver\PDO\Exception:new in /var/www/snipe-it/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:84
#68 PDOException in /var/www/snipe-it/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:79
#67 PDO:prepare in /var/www/snipe-it/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:79
#66 Doctrine\DBAL\Driver\PDOConnection:prepare in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Connection.php:484
#65 Illuminate\Database\Connection:Illuminate\Database{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Connection.php:662
#64 Illuminate\Database\Connection:runQueryCallback in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Connection.php:629
#63 Illuminate\Database\Connection:run in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Connection.php:495
#62 Illuminate\Database\Connection:affectingStatement in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Connection.php:428
#61 Illuminate\Database\Connection:update in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2736
#60 Illuminate\Database\Query\Builder:update in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:799
#59 Illuminate\Database\Eloquent\Builder:update in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:746
#58 Illuminate\Database\Eloquent\Model:performUpdate in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:661
#57 Illuminate\Database\Eloquent\Model:save in /var/www/snipe-it/app/Http/Controllers/SettingsController.php:474
#56 App\Http\Controllers\SettingsController:postBranding in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
#55 Illuminate\Routing\Controller:callAction in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45
#54 Illuminate\Routing\ControllerDispatcher:dispatch in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Route.php:219
#53 Illuminate\Routing\Route:runController in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Route.php:176
#52 Illuminate\Routing\Route:run in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php:681
#51 Illuminate\Routing\Router:Illuminate\Routing{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:130
#50 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/CheckPermissions.php:26
#49 App\Http\Middleware\CheckPermissions:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#48 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php:43
#47 Illuminate\Auth\Middleware\Authenticate:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#46 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/AssetCountForSidebar.php:56
#45 App\Http\Middleware\AssetCountForSidebar:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#44 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php:50
#43 Laravel\Passport\Http\Middleware\CreateFreshApiToken:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#42 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/CheckForTwoFactor.php:53
#41 App\Http\Middleware\CheckForTwoFactor:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#40 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/CheckLocale.php:37
#39 App\Http\Middleware\CheckLocale:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#38 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:78
#37 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#36 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37
#35 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#34 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:67
#33 Illuminate\Cookie\Middleware\EncryptCookies:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#32 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:105
#31 Illuminate\Pipeline\Pipeline:then in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php:683
#30 Illuminate\Routing\Router:runRouteWithinStack in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php:658
#29 Illuminate\Routing\Router:runRoute in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php:624
#28 Illuminate\Routing\Router:dispatchToRoute in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php:613
#27 Illuminate\Routing\Router:dispatch in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:170
#26 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:130
#25 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php:67
#24 Barryvdh\Debugbar\Middleware\InjectDebugbar:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#23 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/SecurityHeaders.php:26
#22 App\Http\Middleware\SecurityHeaders:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#21 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21
#20 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#19 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/CheckForDebug.php:25
#18 App\Http\Middleware\CheckForDebug:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#17 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/CheckForSetup.php:26
#16 App\Http\Middleware\CheckForSetup:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#15 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/fideloper/proxy/src/TrustProxies.php:57
#14 Fideloper\Proxy\TrustProxies:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#13 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49
#12 Illuminate\View\Middleware\ShareErrorsFromSession:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#11 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:56
#10 Illuminate\Session\Middleware\StartSession:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#9 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:63
#8 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#7 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/app/Http/Middleware/NoSessionStore.php:27
#6 App\Http\Middleware\NoSessionStore:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#5 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/barryvdh/laravel-cors/src/HandlePreflight.php:29
#4 Barryvdh\Cors\HandlePreflight:handle in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:171
#3 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline{closure} in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:105
#2 Illuminate\Pipeline\Pipeline:then in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:145
#1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:110
#0 Illuminate\Foundation\Http\Kernel:handle in /var/www/snipe-it/public/index.php:58

@snipe
Copy link
Owner

snipe commented Aug 24, 2021

Your APP_URL needs to be the URL to the Snipe-IT installation.

Column not found: 1054 Unknown column 'allow_user_skin' in 'field list'

Means your migrations didn't run

@snipe
Copy link
Owner

snipe commented Sep 11, 2021

Hi there - We haven't heard back in a bit, so I'm going to close this ticket for now, but will re-open it if you're still having issues.

hackerman-hacking

@snipe snipe closed this as completed Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants