Cannot render from console

rails

#1

Ever since I can remember, I have been getting this message when running a Rails server

Cannot render console from [IP]! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255

I have removed the actual IP shown in the message, just in case.

The server runs fine and the application runs fine as well, but I keep getting this message repeatedly and would like to know what it means?


#2

Something in your application is listening on 0.0.0.0 but only accepts requests from 127.0.0.1. Accessing things via the preview page will come from an external IP.


#3

This should help: http://stackoverflow.com/questions/29417328/how-to-disable-cannot-render-console-from-on-rails


#4

Thanks for the replies guys. I had no idea it was a Rails issue.

So it seems I should white-list the IP shown in the message? I tried that using:

config.web_console.whitelisted_ips = '[] in config/environments/development.rb and restarted the server. But I am still getting this message repeatedly.

By the way, is this something that must be done? What would happen if it’s just left as it is?


#5

I think it’s just a warning so it shouldn’t cause issues.

You should add your personal IP address to that array instead of just having an empty array. Or you can disable the message completely with:

class Application < Rails::Application
  config.web_console.whiny_requests = false
end

As mentioned in the stackoverflow thread.


#6

Thanks Tim :slightly_smiling:


#7

I am getting the same error “Cannot render console from 15.203.137.73! Allowed networks: 15.203.137.73, 127.0.0.0/127.255.255.255, ::1” and because of which I am not able to view my templates any idea?


#8

@timjrobinson: When I test my (unfinished) application, I get this error:
method_missing': undefined methodweb_console’ for # Rails::Application::Configuration:0x00000003ed4970

[ I tried to paste in more than 1 line of the error code; didn’t succeed. ]

Your solution does work; but why this strange test result?


#9

This worked for me! Add the network of the Cloud9 preview servers, to your development.rb file

config.web_console.whitelisted_ips << "10.240.0.0/16" # cloud9's preview network

I’m not sure of c9’s network schematic for different regions, but I was getting a 10.240.0.xxx and a 10.240.1.xxx so I masked the last 16 bits (or 2 octets).