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

500 Error on /api/input #32

Open
chrszlz opened this issue Sep 4, 2019 · 6 comments
Open

500 Error on /api/input #32

chrszlz opened this issue Sep 4, 2019 · 6 comments

Comments

@chrszlz
Copy link

chrszlz commented Sep 4, 2019

I'm trying to use Compass + Overland and am encountering 500 Internal Service Error's when attempting to POST to /api/input while running in MAMP. I see this same issue when I test locally with Postman. It seems the server is rejecting the request due to invalid content types - "Request failed: unacceptable content-type: text/html".

Is there a way to set acceptable content types for the server or is there something else causing this issue?

When testing with Postman, if I send the body GeoJSON data as text/html the server returns a 200 but just can't parse it, if I send as application/json it fails with a 500 even though it's seemingly correctly-formed.

Here's the full printed error Overland's side:

Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={NSLocalizedDescription=Request failed: internal server error (500), NSUnderlyingError=0x600000f879c0 {Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={NSLocalizedDescription=Request failed: unacceptable content-type: text/html, NSErrorFailingURLKey=http://192.168.1.XX/api/input?token=VieLE9Mu3TWRITE, com.alamofire.serialization.response.error.data={length = 4519, bytes = 0x3c21444f 43545950 45206874 6d6c3e0a ... 0a3c2f68 746d6c3e }, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x6000001eed20> { URL: http://192.168.1.XX/api/input?token=VieLE9Mu3TWRITE } { Status Code: 500, Headers {
    "Cache-Control" =     (
        "no-cache, private"
    );
    Connection =     (
        close
    );
    "Content-Length" =     (
        4519
    );
    "Content-Type" =     (
        "text/html; charset=UTF-8"
    );
    Date =     (
        "Wed, 04 Sep 2019 05:28:45 GMT"
    );
    Server =     (
        "Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.3.7 mod_ssl/2.2.34 OpenSSL/1.0.2o DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.10 Perl/v5.24.0"
    );
    "X-Powered-By" =     (
        "PHP/7.3.7"
    );
} }}}, NSErrorFailingURLKey=http://192.168.1.XX/api/input?token=VieLE9Mu3TWRITE, com.alamofire.serialization.response.error.data={length = 4519, bytes = 0x3c21444f 43545950 45206874 6d6c3e0a ... 0a3c2f68 746d6c3e }, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x6000001eed20> { URL: http://192.168.1.XX/api/input?token=VieLE9Mu3TWRITE } { Status Code: 500, Headers {
    "Cache-Control" =     (
        "no-cache, private"
    );
    Connection =     (
        close
    );
    "Content-Length" =     (
        4519
    );
    "Content-Type" =     (
        "text/html; charset=UTF-8"
    );
    Date =     (
        "Wed, 04 Sep 2019 05:28:45 GMT"
    );
    Server =     (
        "Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.3.7 mod_ssl/2.2.34 OpenSSL/1.0.2o DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.10 Perl/v5.24.0"
    );
    "X-Powered-By" =     (
        "PHP/7.3.7"
    );
} }}

@aaronpk
Copy link
Owner

aaronpk commented Sep 4, 2019

Can you get more info on what the server says the 500 error is? Something from the MAMP logs.

@chrszlz
Copy link
Author

chrszlz commented Sep 5, 2019

Thanks for the quick response - I don't get any errors logged from MAMP nor from the Console in Postman. All I get back is the 500 response and the "Whoops, looks like something went wrong." error page.

I'm not sure if it's relevant but I get the same result whether or not artisan's queue listener is running. Do you have any tips as to where I to continue debugging here?

@aaronpk
Copy link
Owner

aaronpk commented Sep 5, 2019

check the log for the app, should be in storage/logs/laravel.log or something.

It sounds like maybe the app isn't finished getting set up? You need a database and optionally Redis. I'm betting that log will tell you more.

@chrszlz
Copy link
Author

chrszlz commented Sep 5, 2019

Does Compass not use mysql by default for the job queue? I have mysql up and running correctly I believe as far as storage is concerned.

Are there any red flags we should be looking for - here are the tail'd logs for the 500 error from lumen.log:

#16 /Users/Chris/code/TrackingTest/server/Compass/compass/vendor/illuminate/pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#17 /Users/Chris/code/TrackingTest/server/Compass/compass/vendor/illuminate/cookie/Middleware/EncryptCookies.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /Users/Chris/code/TrackingTest/server/Compass/compass/vendor/illuminate/pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#20 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /Users/Chris/code/TrackingTest/server/Compass/compass/vendor/illuminate/pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#22 /Users/Chris/code/TrackingTest/server/Compass/compass/vendor/laravel/lumen-framework/src/Application.php(1439): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#23 /Users/Chris/code/TrackingTest/server/Compass/compass/vendor/laravel/lumen-framework/src/Application.php(1213): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#24 /Users/Chris/code/TrackingTest/server/Compass/compass/vendor/laravel/lumen-framework/src/Application.php(1153): Laravel\Lumen\Application->dispatch(NULL)
#25 /Users/Chris/code/TrackingTest/server/Compass/compass/public/index.php(28): Laravel\Lumen\Application->run()
#26 {main} 

@aaronpk
Copy link
Owner

aaronpk commented Sep 5, 2019

Thanks, I need to see the top of that stack for it to be useful. Scroll up to where it says #1 and that should provide more context for this error.

@aaronpk
Copy link
Owner

aaronpk commented Sep 5, 2019

Looks like the default config file has CACHE_DRIVER=redis so it's trying to use redis as a cache. I'm guessing that's the error here. It looks like there is a database cache driver if you don't want to use redis, but that'll involve creating a new table. I should probably just add that to the repo as the default.

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