Instapy: Error establishing a database connection

Created on 10 Nov 2019  路  12Comments  路  Source: timgrossmann/InstaPy

I am now getting this come up on mozilla firefox when running the mac command, can anyone help?

wontfix

Most helpful comment

Hey! After months of being down and "having a block on likes" (but not really), I was able to get this up and running.

Basically, I put the script so it showed the browser window while doing the checks:

session = InstaPy(username=insta_username, password=insta_password, headless_browser=False)

I then saw the "Error Establishing Database Connection" message from the "isitdownorjust.me" website, and realized this is where the process was breaking down.

I then tried commenting out the following lines (472-473 in 0.6.6) however I still got the same error:

`#if "instagram.com/accounts/onetap" in browser.current_url:

browser.get("https://instagram.com")'

I then went into \InstaPy\Login_Util.py and used a string literal to additionally comment out the entire section of code performing this "isitdownorjust.me" check (starts with the triple quotes and ends with the same, lines 210-246):

'

check Instagram.com status
"""try:
logger.info("-- Connection Checklist [2/3] (Instagram Server Status)")
browser.get("https://isitdownorjust.me/instagram-com/")
sleep(2)
# collect isitdownorjust.me website information
website_status = browser.find_element_by_xpath(
read_xpath(login_user.__name__, "website_status")
)
response_time = browser.find_element_by_xpath(
read_xpath(login_user.__name__, "response_time")
)
response_code = browser.find_element_by_xpath(
read_xpath(login_user.__name__, "response_code")
)

logger.info("- Instagram WebSite Status: {} ".format(website_status.text))
logger.info("- Instagram Response Time: {} ".format(response_time.text))
logger.info("- Instagram Reponse Code: {}".format(response_code.text))
logger.info("- Instagram Server Status: ok")
update_activity(
    browser,
    action=None,
    state="Instagram servers are running correctly",
    logfolder=logfolder,
    logger=logger,
)

except Exception:
logger.warn("- Instagram Server Status: error")
update_activity(
browser,
action=None,
state="Instagram server is down",
logfolder=logfolder,
logger=logger,
)
return False"""

check if hide-selenium extension is running

logger.info("-- Connection Checklist [3/3] (Hide Selenium Extension)")
webdriver = browser.execute_script("return window.navigator.webdriver")
`

I'm now back up and liking! Hope this helps everyone else!!

All 12 comments

I'm getting the same error

me too

instapy dead?

Anyone know of any working alternatives?

me too

Instapy uses external website to check if instagram server is working. Ironically server for checking if website is working.. currently is not working. You can wait for them to fix website or you can comment lines for checking instagram server

See #5002

https://isitdownorjust.me/instagram-com/

+1

Hey! After months of being down and "having a block on likes" (but not really), I was able to get this up and running.

Basically, I put the script so it showed the browser window while doing the checks:

session = InstaPy(username=insta_username, password=insta_password, headless_browser=False)

I then saw the "Error Establishing Database Connection" message from the "isitdownorjust.me" website, and realized this is where the process was breaking down.

I then tried commenting out the following lines (472-473 in 0.6.6) however I still got the same error:

`#if "instagram.com/accounts/onetap" in browser.current_url:

browser.get("https://instagram.com")'

I then went into \InstaPy\Login_Util.py and used a string literal to additionally comment out the entire section of code performing this "isitdownorjust.me" check (starts with the triple quotes and ends with the same, lines 210-246):

'

check Instagram.com status
"""try:
logger.info("-- Connection Checklist [2/3] (Instagram Server Status)")
browser.get("https://isitdownorjust.me/instagram-com/")
sleep(2)
# collect isitdownorjust.me website information
website_status = browser.find_element_by_xpath(
read_xpath(login_user.__name__, "website_status")
)
response_time = browser.find_element_by_xpath(
read_xpath(login_user.__name__, "response_time")
)
response_code = browser.find_element_by_xpath(
read_xpath(login_user.__name__, "response_code")
)

logger.info("- Instagram WebSite Status: {} ".format(website_status.text))
logger.info("- Instagram Response Time: {} ".format(response_time.text))
logger.info("- Instagram Reponse Code: {}".format(response_code.text))
logger.info("- Instagram Server Status: ok")
update_activity(
    browser,
    action=None,
    state="Instagram servers are running correctly",
    logfolder=logfolder,
    logger=logger,
)

except Exception:
logger.warn("- Instagram Server Status: error")
update_activity(
browser,
action=None,
state="Instagram server is down",
logfolder=logfolder,
logger=logger,
)
return False"""

check if hide-selenium extension is running

logger.info("-- Connection Checklist [3/3] (Hide Selenium Extension)")
webdriver = browser.execute_script("return window.navigator.webdriver")
`

I'm now back up and liking! Hope this helps everyone else!!

A quick workaround to this would be to use a web debugger like Fiddler to auto-respond to requests to isitdownorjustme with a cached page saying instagram is up. Just tested this and it bypassed the check fine.
Heres a cached page: https://webcache.googleusercontent.com/search?q=cache:vGXv0kGDdmQJ:https://isitdownorjust.me/instagram-com/
Just plug that html file into Fiddler AutoResponder and youre good to go!

This problem is still actual

Hey! After months of being down and "having a block on likes" (but not really), I was able to get this up and running.

Basically, I put the script so it showed the browser window while doing the checks:

session = InstaPy(username=insta_username, password=insta_password, headless_browser=False)

I then saw the "Error Establishing Database Connection" message from the "isitdownorjust.me" website, and realized this is where the process was breaking down.

I then tried commenting out the following lines (472-473 in 0.6.6) however I still got the same error:

`#if "instagram.com/accounts/onetap" in browser.current_url:

browser.get("https://instagram.com")'

I then went into \InstaPy\Login_Util.py and used a string literal to additionally comment out the entire section of code performing this "isitdownorjust.me" check (starts with the triple quotes and ends with the same, lines 210-246):

'

check Instagram.com status
"""try:
logger.info("-- Connection Checklist [2/3] (Instagram Server Status)")
browser.get("https://isitdownorjust.me/instagram-com/")
sleep(2)

collect isitdownorjust.me website information

website_status = browser.find_element_by_xpath(
read_xpath(login_user.name, "website_status")
)
response_time = browser.find_element_by_xpath(
read_xpath(login_user.name, "response_time")
)
response_code = browser.find_element_by_xpath(
read_xpath(login_user.name, "response_code")
)

logger.info("- Instagram WebSite Status: {} ".format(website_status.text))
logger.info("- Instagram Response Time: {} ".format(response_time.text))
logger.info("- Instagram Reponse Code: {}".format(response_code.text))
logger.info("- Instagram Server Status: ok")
update_activity(
    browser,
    action=None,
    state="Instagram servers are running correctly",
    logfolder=logfolder,
    logger=logger,
)

except Exception:
logger.warn("- Instagram Server Status: error")
update_activity(
browser,
action=None,
state="Instagram server is down",
logfolder=logfolder,
logger=logger,
)
return False"""

check if hide-selenium extension is running

logger.info("-- Connection Checklist [3/3] (Hide Selenium Extension)")
webdriver = browser.execute_script("return window.navigator.webdriver")
`

I'm now back up and liking! Hope this helps everyone else!!

Nice workaround, but wouldn't be easier to just replace False with True in the Exception? I know, it is dirty, but still

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

drcyber975 picture drcyber975  路  3Comments

tibor picture tibor  路  3Comments

46960 picture 46960  路  3Comments

thisishotdog picture thisishotdog  路  3Comments