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

404 - Not sure why #793

Closed
bfmbrandonjames opened this issue Jan 4, 2016 · 0 comments
Closed

404 - Not sure why #793

bfmbrandonjames opened this issue Jan 4, 2016 · 0 comments

Comments

@bfmbrandonjames
Copy link

I'm a novice here. I just started with the Laravel framework not long ago.

I'm using Laravel 5.1 and PHP 5.5.9-1ubuntu4.14 so the library is compatible.
I followed the instructions to install from the Dingo docs. I finally finished the setup and I end up with this error code when I visit my virtual host - "https://api.tapecm.com/v1/test". It should be returning { 'message': 'test' }.

I'm going to try to include as much relevant information in this first post as possible.

Route:

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', function ($api) {
    $api->get('test', function () {
        return 'test';
    });
});

Response:

{
  "message": "404 Not Found",
  "status_code": 404,
  "debug": {
    "line": 161,
    "file": "\/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/RouteCollection.php",
    "class": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
    "trace": [
      "#0 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php(750): Illuminate\\Routing\\RouteCollection->match(Object(Dingo\\Api\\Http\\Request))",
      "#1 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php(659): Illuminate\\Routing\\Router->findRoute(Object(Dingo\\Api\\Http\\Request))",
      "#2 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php(635): Illuminate\\Routing\\Router->dispatchToRoute(Object(Dingo\\Api\\Http\\Request))",
      "#3 \/var\/www\/tapapi.com\/vendor\/dingo\/api\/src\/Routing\/Adapter\/Laravel.php(65): Illuminate\\Routing\\Router->dispatch(Object(Dingo\\Api\\Http\\Request))",
      "#4 \/var\/www\/tapapi.com\/vendor\/dingo\/api\/src\/Routing\/Router.php(559): Dingo\\Api\\Routing\\Adapter\\Laravel->dispatch(Object(Dingo\\Api\\Http\\Request), 'v1')",
      "#5 \/var\/www\/tapapi.com\/vendor\/dingo\/api\/src\/Http\/Middleware\/Request.php(110): Dingo\\Api\\Routing\\Router->dispatch(Object(Dingo\\Api\\Http\\Request))",
      "#6 [internal function]: Dingo\\Api\\Http\\Middleware\\Request->Dingo\\Api\\Http\\Middleware\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#7 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(139): call_user_func(Object(Closure), Object(Dingo\\Api\\Http\\Request))",
      "#8 \/var\/www\/tapapi.com\/vendor\/lucadegasperi\/oauth2-server-laravel\/src\/Middleware\/OAuthExceptionHandlerMiddleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#9 [internal function]: LucaDegasperi\\OAuth2Server\\Middleware\\OAuthExceptionHandlerMiddleware->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#10 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#11 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/View\/Middleware\/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#12 [internal function]: Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#13 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#14 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Session\/Middleware\/StartSession.php(62): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#15 [internal function]: Illuminate\\Session\\Middleware\\StartSession->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#16 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#17 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Cookie\/Middleware\/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#18 [internal function]: Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#19 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#20 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Cookie\/Middleware\/EncryptCookies.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#21 [internal function]: Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#22 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#23 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Middleware\/CheckForMaintenanceMode.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#24 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#25 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#26 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#27 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(103): call_user_func(Object(Closure), Object(Dingo\\Api\\Http\\Request))",
      "#28 \/var\/www\/tapapi.com\/vendor\/dingo\/api\/src\/Http\/Middleware\/Request.php(111): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
      "#29 \/var\/www\/tapapi.com\/vendor\/dingo\/api\/src\/Http\/Middleware\/Request.php(89): Dingo\\Api\\Http\\Middleware\\Request->sendRequestThroughRouter(Object(Dingo\\Api\\Http\\Request))",
      "#30 [internal function]: Dingo\\Api\\Http\\Middleware\\Request->handle(Object(Illuminate\\Http\\Request), Object(Closure))",
      "#31 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#32 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
      "#33 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Pipeline\/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
      "#34 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Kernel.php(122): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
      "#35 \/var\/www\/tapapi.com\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Kernel.php(87): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))",
      "#36 \/var\/www\/tapapi.com\/public\/index.php(54): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))",
      "#37 {main}"
    ]
  }
}

I have these third party providers. The only configured one is my MongoDB connection.

    /*
     * Third Party
     */

    // MongoDB
    Jenssegers\Mongodb\MongodbServiceProvider::class,
    // OAuth2
    LucaDegasperi\OAuth2Server\Storage\FluentStorageServiceProvider::class,
    LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider::class,
    // Dingo API
    Dingo\Api\Provider\LaravelServiceProvider::class,
    // Proxify
    Cellcote\LaravelProxify\ApiProxyServiceProvider::class,

Apache api.tapecm.com-ssl.conf directory definition:
<Directory "/var/www/tapapi.com/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted

Only minor problem is configtest fails.
AH00526: Syntax error on line 53 of /etc/apache2/sites-enabled/api.tapecm.com-ssl.conf:
SSLCertificateKeyFile: file '/etc/ssl/private/www.tapecm.com.key' does not exist or is empty

What do I need to do?

EDIT: I'm accessing the wrong URI. I've been putting v1 into the URI. I changed it to /api and it's working...

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

1 participant