I'd like to test multiple mobile user agents with selenium and chrome. I'm using python 3.6 and trying to deploy to heroku. I'm using headless chrome=68.0.3440.75 chromedriver 2.40.565383 . Based on http://chromedriver.chromium.org/mobile-emulation :
def create_chromedriver(ua=False):
options = webdriver.ChromeOptions()
CHROMEDRIVER_PATH = os.getenv('$HOME') or basedir+'/chromedriver.exe'
FLASK_CONFIG = os.getenv('FLASK_CONFIG')
if FLASK_CONFIG and FLASK_CONFIG == "production":
# CHROMEDRIVER_PATH = '/app/.chromedriver/bin/chromedriver'
CHROMEDRIVER_PATH = '/app/.chromedriver/bin/chromedriver'
GOOGLE_CHROME_SHIM = os.getenv('$GOOGLE_CHROME_SHIM') or 'no path found'
print(GOOGLE_CHROME_SHIM)
print(GOOGLE_CHROME_SHIM)
options.add_argument("--headless")
options.add_argument("--disable-gpu")
if ua:
print('ua block33')
mobile_emulation = {"deviceName": "iPad Mini"}
options.add_experimental_option("mobileEmulation", mobile_emulation)
return webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, chrome_options=options)
def some_long_calculation():
driver = create_chromedriver('test')
# driver = create_chromedriver()
print(driver.capabilities['version'])
print(driver.capabilities['version'])
driver.get("https://www.yahoo.com/")
print(1)
png = driver.get_screenshot_as_png()
driver.close()
# return 'a'
return png
On both windows locally and if I run on heroku with When I run this project on heroku using
def some_long_calculation():
# driver = create_chromedriver('test')
driver = create_chromedriver()
I get the expected yahoo screenshot
However using :
def some_long_calculation():
driver = create_chromedriver('test')
results in:
2018-07-26T15:08:21.448393+00:00 heroku[web.1]: State changed from starting to up
2018-07-26T15:08:23.555153+00:00 app[web.1]: no path found
2018-07-26T15:08:23.555197+00:00 app[web.1]: no path found
2018-07-26T15:08:23.555199+00:00 app[web.1]: ua block33
2018-07-26T15:08:25.772281+00:00 heroku[router]: at=info method=GET path="/" host=mobiletest16.herokuapp.com request_id=4f72f6b0-3d8f-418f-a01b-a0281c4f644d fwd="54.86.59.209" dyno=web.1 connect=0ms service=2219ms status=500 bytes=456 protocol=https
2018-07-26T15:08:25.770879+00:00 app[web.1]: [2018-07-26 15:08:25,756] ERROR in app: Exception on / [GET]
2018-07-26T15:08:25.770892+00:00 app[web.1]: Traceback (most recent call last):
2018-07-26T15:08:25.770894+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
2018-07-26T15:08:25.770895+00:00 app[web.1]: response = self.full_dispatch_request()
2018-07-26T15:08:25.770897+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
2018-07-26T15:08:25.770899+00:00 app[web.1]: rv = self.handle_user_exception(e)
2018-07-26T15:08:25.770900+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
2018-07-26T15:08:25.770902+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2018-07-26T15:08:25.770904+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
2018-07-26T15:08:25.770907+00:00 app[web.1]: raise value
2018-07-26T15:08:25.770908+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
2018-07-26T15:08:25.770910+00:00 app[web.1]: rv = self.dispatch_request()
2018-07-26T15:08:25.770911+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
2018-07-26T15:08:25.770913+00:00 app[web.1]: return self.view_functions[rule.endpoint](**req.view_args)
2018-07-26T15:08:25.770914+00:00 app[web.1]: File "/app/err_test.py", line 115, in sanity_check
2018-07-26T15:08:25.770916+00:00 app[web.1]: png = some_long_calculation()
2018-07-26T15:08:25.770918+00:00 app[web.1]: File "/app/err_test.py", line 89, in some_long_calculation
2018-07-26T15:08:25.770919+00:00 app[web.1]: driver = create_chromedriver('test')
2018-07-26T15:08:25.770921+00:00 app[web.1]: File "/app/err_test.py", line 78, in create_chromedriver
2018-07-26T15:08:25.770923+00:00 app[web.1]: return webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, options=options)
2018-07-26T15:08:25.770925+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 75, in __init__
2018-07-26T15:08:25.770926+00:00 app[web.1]: desired_capabilities=desired_capabilities)
2018-07-26T15:08:25.770928+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 156, in __init__
2018-07-26T15:08:25.770929+00:00 app[web.1]: self.start_session(capabilities, browser_profile)
2018-07-26T15:08:25.770931+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 251, in start_session
2018-07-26T15:08:25.770933+00:00 app[web.1]: response = self.execute(Command.NEW_SESSION, parameters)
2018-07-26T15:08:25.770934+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute
2018-07-26T15:08:25.770936+00:00 app[web.1]: self.error_handler.check_response(response)
2018-07-26T15:08:25.770937+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
2018-07-26T15:08:25.770939+00:00 app[web.1]: raise exception_class(message, screen, stacktrace)
2018-07-26T15:08:25.770944+00:00 app[web.1]: selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception
2018-07-26T15:08:25.770946+00:00 app[web.1]: from tab crashed
2018-07-26T15:08:25.770948+00:00 app[web.1]: (Session info: headless chrome=68.0.3440.75)
2018-07-26T15:08:25.770949+00:00 app[web.1]: (Driver info: chromedriver=2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7),platform=Linux 4.4.0-1019-aws x86_64)
2018-07-26T15:08:25.771063+00:00 app[web.1]:
2018-07-26T15:08:25.773980+00:00 app[web.1]: 10.30.235.45 - - [26/Jul/2018:15:08:25 +0000] "GET / HTTP/1.1" 500 291 "https://dashboard.heroku.com/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
How can I get this working?
You can download my project for both windows and heroku use at:
https://github.com/kc1/mobiletest
(keep in mind that if you deploy to heroku you have to set FLASK_CONFIG to production. Also you will need to add the 3 buildpacks shown in the screenshot.)
Related
I'm trying to create my first database here, but I get this error:(error image)
I also checked the log and this is what I found:
022-08-14 23:10:15,799 6576 INFO ? odoo.sql_db: Connection to the database failed
2022-08-14 23:10:15,839 6576 INFO None odoo.service.db: Create database `odoo_db`.
2022-08-14 23:10:15,874 6576 INFO None odoo.sql_db: Connection to the database failed
2022-08-14 23:10:15,875 6576 ERROR None odoo.http:
Traceback (most recent call last):
File "C:\Program Files\Odoo\server\odoo\http.py", line 141, in dispatch_rpc
result = dispatch(method, params)
File "C:\Program Files\Odoo\server\odoo\service\db.py", line 462, in dispatch
return g[exp_method_name](*params)
File "<decorator-gen-14>", line 2, in exp_create_database
File "C:\Program Files\Odoo\server\odoo\service\db.py", line 41, in if_db_mgt_enabled
return method(self, *args, **kwargs)
File "C:\Program Files\Odoo\server\odoo\service\db.py", line 130, in exp_create_database
_create_empty_database(db_name)
File "C:\Program Files\Odoo\server\odoo\service\db.py", line 99, in _create_empty_database
with closing(db.cursor()) as cr:
File "C:\Program Files\Odoo\server\odoo\sql_db.py", line 709, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File "C:\Program Files\Odoo\server\odoo\sql_db.py", line 259, in __init__
self._cnx = pool.borrow(dsn)
File "C:\Program Files\Odoo\server\odoo\sql_db.py", line 592, in _locked
return fun(self, *args, **kwargs)
File "C:\Program Files\Odoo\server\odoo\sql_db.py", line 660, in borrow
**connection_info)
File "C:\Program Files\Odoo\python\lib\site-packages\psycopg2\__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError
2022-08-14 23:10:15,939 6576 INFO None odoo.sql_db: Connection to the database failed
2022-08-14 23:10:15,964 6576 INFO None werkzeug: 127.0.0.1 - - [14/Aug/2022 23:10:15] "POST /web/database/create HTTP/1.1" 200 - 0 0.000 5.881
2022-08-14 23:10:16,162 6576 INFO ? odoo.sql_db: Connection to the database failed
2022-08-14 23:10:16,165 6576 INFO ? werkzeug: 127.0.0.1 - - [14/Aug/2022 23:10:16] "GET /web/database/Roboto-Regular.ttf HTTP/1.1" 404 - 0 0.000 0.047
I have try of differents ways to install odoo 10 in my mac osx (10.11.6).
always receive the same error.
I did the instalation using a virtual env.
The installation ended fine, but I haven't be able to run it.
it seems a issue with db connection but where and how
(odoo-env)Nelsons-MacBook-Air:odoo nelsondiaz$ ./odoo-bin
2017-08-29 14:44:22,963 18435 INFO ? odoo: Odoo version 10.0
2017-08-29 14:44:22,963 18435 INFO ? odoo: addons paths: ['/Users/nelsondiaz/Library/Application Support/Odoo/addons/10.0', u'/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/addons', u'/Users/nelsondiaz/Sites/odoo-env/odoo/addons']
2017-08-29 14:44:22,963 18435 INFO ? odoo: database: default#default:default
2017-08-29 14:44:22,978 18435 INFO ? odoo.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
This is the error after running http://127.0.0.1:8069/ or http://localhost:8069/
I try updating pg_hba.conf and odoo.conf
nothing work, the same error
2017-08-29 14:50:25,948 18435 INFO ? odoo.sql_db: Connection to the database failed
2017-08-29 14:50:25,952 18435 INFO ? werkzeug: 127.0.0.1 - - [29/Aug/2017 14:50:25] "GET / HTTP/1.1" 500 -
2017-08-29 14:50:25,965 18435 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 181, in execute
application_iter = app(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/server.py", line 249, in app
return self.app(e, s)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/wsgi_server.py", line 186, in application
return application_unproxied(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/wsgi_server.py", line 172, in application_unproxied
result = handler(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1308, in __call__
return self.dispatch(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1282, in __call__
return self.app(environ, start_wrapped)
File "/Library/Python/2.7/site-packages/werkzeug/wsgi.py", line 599, in __call__
return self.app(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1446, in dispatch
self.setup_db(httprequest)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1368, in setup_db
httprequest.session.db = db_monodb(httprequest)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1524, in db_monodb
dbs = db_list(True, httprequest)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1498, in db_list
dbs = odoo.service.db.list_dbs(force)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/db.py", line 325, in list_dbs
with closing(db.cursor()) as cr:
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 635, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 177, in __init__
self._cnx = pool.borrow(dsn)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 518, in _locked
return fun(self, *args, **kwargs)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 586, in borrow
**connection_info)
File "/Library/Python/2.7/site-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
OperationalError: fe_sendauth: no password supplied
2017-08-29 14:50:26,238 18435 INFO ? odoo.sql_db: Connection to the database failed
2017-08-29 14:50:26,242 18435 INFO ? werkzeug: 127.0.0.1 - - [29/Aug/2017 14:50:26] "GET /favicon.ico HTTP/1.1" 500 -
2017-08-29 14:50:26,249 18435 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 193, in run_wsgi
execute(self.server.app)
File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 181, in execute
application_iter = app(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/server.py", line 249, in app
return self.app(e, s)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/wsgi_server.py", line 186, in application
return application_unproxied(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/wsgi_server.py", line 172, in application_unproxied
result = handler(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1308, in __call__
return self.dispatch(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1282, in __call__
return self.app(environ, start_wrapped)
File "/Library/Python/2.7/site-packages/werkzeug/wsgi.py", line 599, in __call__
return self.app(environ, start_response)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1446, in dispatch
self.setup_db(httprequest)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1368, in setup_db
httprequest.session.db = db_monodb(httprequest)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1524, in db_monodb
dbs = db_list(True, httprequest)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/http.py", line 1498, in db_list
dbs = odoo.service.db.list_dbs(force)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/service/db.py", line 325, in list_dbs
with closing(db.cursor()) as cr:
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 635, in cursor
return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 177, in __init__
self._cnx = pool.borrow(dsn)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 518, in _locked
return fun(self, *args, **kwargs)
File "/Users/nelsondiaz/Sites/odoo-env/odoo/odoo/sql_db.py", line 586, in borrow
**connection_info)
File "/Library/Python/2.7/site-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
OperationalError: fe_sendauth: no password supplied
I couldn't run the server without error only with the command ./odoo-bin
For any reason that I don't know it does not find the conf file.
That I did it was put the conf file in the parameter and it works:
option 1:
./odoo-bin --addons-path=/Users/myuser/Sites/odoo-env/odoo/addons -c debian/odoo.conf
Option 2
./odoo-bin -d odoo --db_user odoo --db_password odoo
I'm getting the following error from selenium:
File "clint-selenium.py", line 58, in <module>
browser = Chrome()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 407, in execute
return self._request(command_info[0], url, body=data)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 439, in _request
resp = self._conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1136, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 417, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
I am calling it with code:
from contextlib import closing
from selenium.webdriver import Chrome # pip install selenium
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
browser = Chrome()
browser.get('http://www.google.com')
time.sleep(1)
print browser.title
browser.quit()
I have evidently done something to my laptop because this used to work. Any thoughts
EDIT
I've tried updating chromedriver but I'm now getting
Traceback (most recent call last):
File "clint-selenium.py", line 58, in <module>
browser = Chrome()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"13524.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=54.0.2840.90)
(Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 4.4.0-45-generic x86_64)
This seems to indicate I'm still not using the latest version. I've followed a couple of guides about installation and I'm getting the same result. Any thoughts
Chromedriver was apparently updated on 2016-10-22, after which I also encountered this problem. Updating to the new version of Chromedriver (2.25) fixed it for me.
Heroku Application error
I don't understand why this will be happen.Can anyone tell me why this will be happening...?
Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
Logs
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/config.ru:in `new'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/config.ru:in `<main>'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
2014-01-15T09:12:41.883290+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
2014-01-15T09:12:41.882761+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
2014-01-15T09:12:41.883859+00:00 app[web.1]: from bin/rails:4:in `require'
2014-01-15T09:12:41.883457+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
2014-01-15T09:12:41.883859+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
2014-01-15T09:12:41.883859+00:00 app[web.1]: from bin/rails:4:in `<main>'
2014-01-15T09:12:41.913025+00:00 app[web.1]: => Booting WEBrick
2014-01-15T09:12:41.913025+00:00 app[web.1]: => Rails 4.0.2 application starting in production on http://0.0.0.0:49194
2014-01-15T09:12:41.913025+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-01-15T09:12:41.913025+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-01-15T09:12:41.913025+00:00 app[web.1]: Exiting
2014-01-15T09:12:43.365057+00:00 heroku[web.1]: Process exited with status 1
2014-01-15T09:12:43.388570+00:00 heroku[web.1]: State changed from starting to crashed
2014-01-15T09:34:57.545417+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=scitech.herokuapp.com fwd="39.36.135.145" dyno= connect= service= status=503 bytes=
2014-01-15T09:34:58.737978+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=scitech.herokuapp.com fwd="39.36.135.145" dyno= connect= service= status=503 bytes=
2014-01-15T09:39:33.012548+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=scitech.herokuapp.com fwd="39.42.60.156" dyno= connect= service= status=503 bytes=
2014-01-15T09:39:37.499410+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=scitech.herokuapp.com fwd="39.42.60.156" dyno= connect= service= status=503 bytes=
2014-01-15T09:39:37.937049+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=scitech.herokuapp.com fwd="39.42.60.156" dyno= connect= service= status=503 bytes=
2014-01-15T09:39:31.872794+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=scitech.herokuapp.com fwd="39.42.60.156" dyno= connect= service= status=503 bytes=
2014-01-15T09:40:42.463904+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=scitech.herokuapp.com fwd="39.42.60.156" dyno= connect= service= status=503 bytes=
2014-01-15T09:40:43.143297+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=scitech.herokuapp.com fwd="39.42.60.156" dyno= connect= service= status=503 bytes=
2014-01-15T09:43:54.807645+00:00 heroku[web.1]: State changed from crashed to starting
2014-01-15T09:43:57.879492+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 4381 -e $RAILS_ENV`
2014-01-15T09:44:00.873725+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require': /app/app/models/banners.rb:2: syntax error, unexpected tIDENTIFIER, expecting '}' (SyntaxError)
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
2014-01-15T09:44:00.873725+00:00 app[web.1]: validates :title, presence: true, length: {minimum: 5 maximum: 25}
2014-01-15T09:44:00.873725+00:00 app[web.1]: ^
2014-01-15T09:44:00.873725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
2014-01-15T09:44:00.873725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
2014-01-15T09:44:00.873725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
2014-01-15T09:44:00.873725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:330:in `require_or_load'
2014-01-15T09:44:00.873725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:289:in `depend_on'
2014-01-15T09:44:00.873725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:207:in `require_dependency'
2014-01-15T09:44:00.873725+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:464:in `each'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:464:in `block in eager_load!'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:462:in `each'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:462:in `eager_load!'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:347:in `eager_load!'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:56:in `each'
2014-01-15T09:44:00.874065+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
2014-01-15T09:44:00.874393+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/config.ru:in `new'
2014-01-15T09:44:00.875246+00:00 app[web.1]: from /app/config.ru:in `<main>'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-01-15T09:44:00.875456+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
2014-01-15T09:44:00.875890+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
2014-01-15T09:44:00.875890+00:00 app[web.1]: from bin/rails:4:in `<main>'
2014-01-15T09:44:00.898780+00:00 app[web.1]: => Booting WEBrick
2014-01-15T09:44:00.898780+00:00 app[web.1]: => Rails 4.0.2 application starting in production on http://0.0.0.0:4381
2014-01-15T09:44:00.898780+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-01-15T09:44:00.898780+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-01-15T09:44:00.898780+00:00 app[web.1]: Exiting
2014-01-15T09:44:00.875890+00:00 app[web.1]: from bin/rails:4:in `require'
2014-01-15T09:44:02.058347+00:00 heroku[web.1]: Process exited with status 1
2014-01-15T09:44:02.077676+00:00 heroku[web.1]: State changed from starting to crashed
2014-01-15T09:44:13.799826+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=scitech.herokuapp.com fwd="39.42.60.156" dyno= connect= service= status=503 bytes=
You have a syntax error in the banners.rb file. Line validates :title, presence: true, length: {minimum: 5 maximum: 25} should be
validates :title, presence: true, length: {minimum: 5, maximum: 25}
I run this on my local machine it works fine...but when I upload to heroku
I get an error 500 something when wrong
settings controller
class SettingsController < ApplicationController
before_filter :confirm_logged_in
def company
#company = User.company
#user_id = session[:user_id]
#user_name = session[:name]
#companies = Company.where(:user_id => #user_id)
end
end
setting view
<% #companies.each do |company| %>
<div id="media">
<span class="lop">
<%= image_tag company.logo.url (:small) %>
</span>
<% end>
I check heroku logs this is what I get...any ideas
2011-02-18T01:09:24-08:00 app[web.1]: Started GET "/settings/company" for 69.137
.99.169 at Fri Feb 18 01:09:24 -0800 2011
2011-02-18T01:09:24-08:00 app[web.1]: Processing by SettingsController#company
as HTML
2011-02-18T01:09:24-08:00 app[web.1]: /app/928a2790-dfe4-4726-8793-1fa99837495b/
home/app/views/settings/company.html.erb:14: warning: don't put space before arg
ument parentheses
2011-02-18T01:09:24-08:00 app[web.1]: Rendered settings/_menu.html.erb (2.1ms)
2011-02-18T01:09:24-08:00 app[web.1]: Rendered settings/company.html.erb within
layouts/application (6.8ms)
2011-02-18T01:09:24-08:00 app[web.1]: Completed in 22ms
2011-02-18T01:09:24-08:00 app[web.1]:
2011-02-18T01:09:24-08:00 app[web.1]: ActionView::Template::Error (PGError: ERRO
R: operator does not exist: text = integer
2011-02-18T01:09:24-08:00 app[web.1]: LINE 1: ...ompanies".* FROM "companies" WH
ERE "companies"."user_id" = 3
2011-02-18T01:09:24-08:00 app[web.1]:
^
2011-02-18T01:09:24-08:00 app[web.1]: HINT: No operator matches the given name
and argument type(s). You might need to add explicit type casts.
2011-02-18T01:09:24-08:00 app[web.1]: : SELECT "companies".* FROM "companies" WH
ERE "companies"."user_id" = 3):
2011-02-18T01:09:24-08:00 app[web.1]: 8:
2011-02-18T01:09:24-08:00 app[web.1]: 9:
2011-02-18T01:09:24-08:00 app[web.1]: 10:
2011-02-18T01:09:24-08:00 app[web.1]: 11:
2011-02-18T01:09:24-08:00 app[web.1]: 12:
2011-02-18T01:09:24-08:00 app[web.1]: 13:
2011-02-18T01:09:24-08:00 app[web.1]: 14:
2011-02-18T01:09:24-08:00 app[web.1]: app/views/settings/company.html.erb:11:i
n `_app_views_settings_company_html_erb___121502233_23577600314100_0'
2011-02-18T01:09:24-08:00 app[web.1]:
2011-02-18T01:09:24-08:00 app[web.1]:
2011-02-18T01:09:24-08:00 heroku[router]: GET miso3.heroku.com/settings/company
dyno=web.1 queue=0 wait=0ms service=36ms bytes=934
2011-02-18T01:09:24-08:00 heroku[nginx]: GET /settings/company HTTP/1.1 | 69.137
.99.169 | 965 | http | 500
2011-02-18T01:33:03-08:00 app[web.1]:
2011-02-18T01:33:03-08:00 app[web.1]:
2011-02-18T01:33:03-08:00 app[web.1]: Started GET "/settings/company" for 69.137
.99.169 at Fri Feb 18 01:33:03 -0800 2011
2011-02-18T01:33:03-08:00 app[web.1]: Processing by SettingsController#company
as HTML
2011-02-18T01:33:03-08:00 app[web.1]: Rendered settings/_menu.html.erb (1.5ms)
2011-02-18T01:33:03-08:00 app[web.1]: Rendered settings/company.html.erb within
layouts/application (3.9ms)
2011-02-18T01:33:03-08:00 app[web.1]: Completed in 5ms
2011-02-18T01:33:03-08:00 app[web.1]:
2011-02-18T01:33:03-08:00 app[web.1]: ActionView::Template::Error (PGError: ERRO
R: operator does not exist: text = integer
2011-02-18T01:33:03-08:00 app[web.1]: LINE 1: ...ompanies".* FROM "companies" WH
ERE "companies"."user_id" = 3
2011-02-18T01:33:03-08:00 app[web.1]:
^
2011-02-18T01:33:03-08:00 app[web.1]: HINT: No operator matches the given name
and argument type(s). You might need to add explicit type casts.
2011-02-18T01:33:03-08:00 app[web.1]: : SELECT "companies".* FROM "companies" WH
ERE "companies"."user_id" = 3):
2011-02-18T01:33:03-08:00 app[web.1]: 8:
2011-02-18T01:33:03-08:00 app[web.1]: 9:
2011-02-18T01:33:03-08:00 app[web.1]: 10:
2011-02-18T01:33:03-08:00 app[web.1]: 11:
2011-02-18T01:33:03-08:00 app[web.1]: 12:
2011-02-18T01:33:03-08:00 app[web.1]: 13:
2011-02-18T01:33:03-08:00 app[web.1]: 14:
2011-02-18T01:33:03-08:00 app[web.1]: app/views/settings/company.html.erb:11:i
n `_app_views_settings_company_html_erb___121502233_23577600314100_0'
2011-02-18T01:33:03-08:00 app[web.1]:
2011-02-18T01:33:03-08:00 app[web.1]:
2011-02-18T01:33:03-08:00 heroku[router]: GET miso3.heroku.com/settings/company
dyno=web.1 queue=0 wait=0ms service=20ms bytes=934
2011-02-18T01:33:03-08:00 heroku[nginx]: GET /settings/company HTTP/1.1 | 69.137
.99.169 | 965 | http | 500