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

Test connection to external databas posgresql not working #55

Open
Doprintityourself opened this issue Apr 9, 2021 · 12 comments
Open

Comments

@Doprintityourself
Copy link

I have setup everything like your guides tell.

I have 2 octoprint raspi 4 running in the same network.

connection is opended and set to my network range,
postgress database is running fine
but,
I cannot connect from both octoprint installations of filament manger to the database,
on the local install and on the remote install, the test connection newer turns green!

Any help appreciated
Thanks in advance

@OllisGit
Copy link
Owner

@Doprintityourself
please provide a octoprint.log. without more details I can't analyse the issue.

@OllisGit OllisGit added the status: waitingForFeedback Wating for Customers feedback label Apr 19, 2021
@Xiondewah
Copy link

I've also got this issue - octoprint.log attached

Thanks.
octoprint.log

@Doprintityourself
Copy link
Author

Doprintityourself commented Apr 30, 2021

octoprint (8).log
Tried with another instance to login.
Even if the database is running and available on another device, it either seem to not work at all and as an result of this is not working at all also no green database test button, when try to setup and connect.

@Doprintityourself
Copy link
Author

ok another experience update:
it did not work after hitting the test button (not green) and save!!
but
after reboot the instance device is now connected!
So would be interesting what the log above tells Olli.

@Doprintityourself
Copy link
Author

and last update from the same pi above but seccond instance,
If external database enabled with correct parameters

  • Test button does not turn green
  • save and exit setup dialog
  • refresh
  • restart octoprint service
    no database content appears.
    After reboot database is connected and working!
    octoprint (11).log

@Doprintityourself
Copy link
Author

ashes on my head 👍
may be I found an error why the filament-manger not worked after restarting octoprint service
I have forgotten to change the restart command to the seccond Instance (as I use up to 4 Instances per pie!)
will test!
but this does not change that green button and database does not work right after configuring the external database

@Doprintityourself
Copy link
Author

https://user-images.githubusercontent.com/70262325/116733053-e89dda80-a9eb-11eb-8aa0-d3bffcddd06d.mp4
so, final investigation: database is working if you restart the right service at once ;-) ,but
it remains the button does not turn green on testing, to have a "at once" feedback if it is working

Hint, it was the first time that after hitting the button, that it did not show the text of the button.
I think is a tribute of the screen capture tool.

So conclusion: The only problem still left :"button does not turn green"!

hope this helps

@Xiondewah
Copy link

I'm afraid it's just not working for me. Can't connect either on the pi with the DB or the second pi with updated connection settings.

@OllisGit
Copy link
Owner

OllisGit commented Jun 5, 2021

@Xiondewah, please take a look into your current octoprint.log.

Maybe there is still this issue:

octoprint.plugins.filamentmanager - ERROR - Failed to initialize database: No module named 'psycopg2'
ModuleNotFoundError: No module named 'psycopg2'

You have couple of options to fix this. Sometime a simple install helps (make sure you install it in the used Octoprint python):

pip install psycopg2

Sometime it is need to install also some dependencies

$ sudo apt-get update
$ sudo apt-get install python-dev libpq-dev

Or take a look into other issues with the same problem, like this: #10 (comment)
Or #4 (comment)

@OllisGit
Copy link
Owner

fyi: the new version 1.9.0 shows more information, why the db-connection is not working.

@OllisGit OllisGit added status: waitingForTestFeedback and removed status: waitingForFeedback Wating for Customers feedback labels Oct 17, 2021
@ZombiesLoveMe
Copy link

I am having similar issues have set everything up on my OctoFarm server and on my OctoPrint servers and cannot get them to connect the issue i seem to be having is filament manager is not initializing, here is my octoprint.log
octoprint.log

@OllisGit
Copy link
Owner

OllisGit commented Nov 15, 2021

Hi @ZombiesLoveMe,

after the server starts the initialize methode is executed and throws this error:

2021-11-09 14:03:55,343 - octoprint.plugins.filamentmanager - ERROR - Failed to initialize database: (psycopg2.OperationalError) could not connect to server: Connection refused
	Is the server running on host "192.168.0.34" and accepting
	TCP/IP connections on port 5432?

After that, there is a follow up issue trigger from on_after_startup , because (as you already mentioned) the filamentManager was not setup correctly.

    all_selections = self.filamentManager.get_all_selections(self.client_id)
AttributeError: 'NoneType' object has no attribute 'get_all_selections'

So, please make sure your connection settings are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants