Sails: [Bug] Route error [404], Ignored attempt to bind route, unkown controller has sub forder

Created on 19 Oct 2016  路  12Comments  路  Source: balderdashy/sails

Sails version: 0.12.7
Node version: 4.4.7
NPM version: 3.10.8
Operating system: windows 10 pro


To reproduce you can follow these steps:

  1. controller forder list:
- api
    |- controllers
            |- api
                  |- UserController.js
             |- page
                  |- HomeController.js
  1. config/routes.js
 module.exports.routes = {
   '/': {
     controller: "page/HomeController",
     action: "default"
   }
 };
  1. Start sails:
    node app.js
  1. You will see the following logs:
    Ignored attempt to bind route (/) to unkown controller :: page/home

What's happen?

And im breakpoint and looked global variable

sails.controllers: 
    "page\home"

Controllers sub forder separator is windows separator "\", not url separator "/"

Most helpful comment

Windows 10 pro
Node: 6.9.0
Sails 0.12.7
I'm seeing this issue too. If your route has a forward slash in the path to your controller for example it will fail to register it, if you use two back slashes it is fine. It is really very easy to reproduce.:

  1. Create a new project
  2. Create a single controller, but put it at least one director deep.
  3. Create a custom route to your controller. Example:
    'get /v1/status1': 'v1\\StatusController.index'
    'get /v1/status2': 'v1/StatusController.index'

/v1/status1 route will work v1/status2 will not. It should also be noted this behaviour has only been observed on Windows so far.

All 12 comments

Hi @cjy37! It looks like you missed a step or two when you created your issue. Please edit your comment (use the pencil icon at the top-right corner of the comment box) and fix the following:

  • Verify "I am experiencing a concrete technical issue (aka a bug) with Sails (ideas and feature proposals should follow the guide for proposing features and enhancements (http://bit.ly/sails-feature-guide), which involves making a pull request). If you're not 100% certain whether it's a bug or not, that's okay--you may continue. The worst that can happen is that the issue will be closed and we'll point you in the right direction."
  • Verify "I am not asking a question about how to use Sails or about whether or not Sails has a certain feature (please refer to the documentation(http://sailsjs.org), or post on http://stackoverflow.com, our Google Group (http://bit.ly/sails-google-group) or our live chat (https://gitter.im/balderdashy/sails)."
  • Verify "I have already searched for related issues, and found none open (if you found a related _closed_ issue, please link to it in your post)."
  • Verify "My issue title is concise, on-topic and polite ("jst.js being removed from layout.ejs on lift" is good; "templates dont work" or "why is sails dumb" are not so good)."
  • Verify "I have tried all the following (if relevant) and my issue remains:"
  • Verify "I can provide steps to reproduce this issue that others can follow."

As soon as those items are rectified, post a new comment (e.g. “Ok, fixed!”) below and we'll take a look. Thanks!

_If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact [email protected]._

Ok, fixed!

Sorry to be a hassle, but it looks like your issue is still missing some required info. Please double-check your initial comment and try again.

_If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact [email protected]._

Ok, fixed!

Sorry to be a hassle, but it looks like your issue is still missing some required info. Please double-check your initial comment and try again.

_If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact [email protected]._

Windows 10 pro
Node: 6.9.0
Sails 0.12.7
I'm seeing this issue too. If your route has a forward slash in the path to your controller for example it will fail to register it, if you use two back slashes it is fine. It is really very easy to reproduce.:

  1. Create a new project
  2. Create a single controller, but put it at least one director deep.
  3. Create a custom route to your controller. Example:
    'get /v1/status1': 'v1\\StatusController.index'
    'get /v1/status2': 'v1/StatusController.index'

/v1/status1 route will work v1/status2 will not. It should also be noted this behaviour has only been observed on Windows so far.

I should also add this started happening in sails 0.12.5. In the above statement the reverse is true in regards to routes prior to 0.12.5

@LeeGDavis see #3858 -- this is a symptom of the same issue, so the same fix should apply. Please give it a test and close if it looks good!

@cjy37 @LeeGDavis just following up on this guys, going to give it the "waiting to close" label. If you're still seeing it after applying the fix from #3858, just post here and let us know (and @sailsbot will automatically remove that label)

@mikermcneil @sgress454 @cjy37 This issue is resolved for me after applying the fix in #3858.

Good, include-all update to 1.0.8, this issue fixed! @LeeGDavis @mikermcneil @sgress454

Ok, fixed!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

victory-deployment picture victory-deployment  路  4Comments

anissen picture anissen  路  3Comments

randallmeeker picture randallmeeker  路  4Comments

alxndrsn picture alxndrsn  路  4Comments

Noitidart picture Noitidart  路  4Comments