03-15-2011, 06:08 AM | #1 |
Enthusiast
Posts: 26
Karma: 168
Join Date: May 2005
Location: Wuhan, China
Device: Kindle DXG
|
ERROR: No internet connection on Linux
The message:
calibre, version 0.7.49 ERROR: No internet connection: Cannot download news as no internet connection is active the linux box is running Debian Squeeze, network interfaces are brought up by /etc/network/interfaces instead of Gnome NetworkManager. Calibre works fine when the internet is connected via a home router. But when the linux box dial up ADSL directly using pon command, Calibre stopped fetching news and gave the above error message. in the meantime, the command line ebook-convert still works. I guess it relate to calibre.utils.network.LinuxNetworkStatus(), any ideas? |
03-15-2011, 06:17 AM | #2 |
Grand Sorcerer
Posts: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Are you asking how to change the code yourself to fix this, or that someone else fix it?
|
Advert | |
|
03-15-2011, 08:33 AM | #3 |
Enthusiast
Posts: 26
Karma: 168
Join Date: May 2005
Location: Wuhan, China
Device: Kindle DXG
|
I use dbus-inspector play around with dbus for a while, can not figure out how to change the code, since there seems no way to check a connection by inspect dbus if the connection is not bring up by NetworkManager. It is also very strange that calibre's fetching works before switch to pon command.
After go through /etc/network/interfaces again, I find it had been modified by NetworkManager for quite a while, so I am *using* NetworkManager all along, although there is no NetworkManager gnome applet running. After disable the NetworkManager daemon, calibre start fetching news again. So it is either let NetworkManager manage network interface, or disable it completely, otherwise, calibre will have trouble to figure out internet connection status when it look up dbus. |
03-15-2011, 09:07 AM | #4 |
Grand Sorcerer
Posts: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Moderator Notice
Moved to appropriate forum |
03-15-2011, 12:00 PM | #5 |
creator of calibre
Posts: 43,849
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you are not using network manager to manage your connection, then shut it down. If calibre detects no network manager it does not do connection checking.
|
Advert | |
|
03-25-2011, 06:30 PM | #6 |
Kindle lover/Linux user
Posts: 23
Karma: 16
Join Date: Jan 2011
Device: Kindle 2i
|
I had the same problem (I run Ubuntu 10.10). I fixed it by running "sudo apt-get remove network-manager-gnome"
|
04-25-2011, 06:51 PM | #7 |
Member
Posts: 20
Karma: 11190
Join Date: Mar 2011
Device: various
|
Kovid, when are you going to resolve this issue correctly? Depending upon Network Manager is silly when there are any number of better ways to determine whether or not a network connection is active.
For that matter, why are you attempting to do network detection in the first place? Just let the OS tell you if it can't forward on a packet. That's what the standard TCP/IP stack is designed to do. Your app is WAY too high up the stack to be making accurate assessments about the network and physical layer. |
04-25-2011, 08:20 PM | #8 |
creator of calibre
Posts: 43,849
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Never. And I am not going to explain to you why. If you think you know how to "do this correctly" in a way that will actually work on more than your own linux setup, feel free to submit a patch.
|
04-25-2011, 08:59 PM | #9 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
I would love to here these better ways. Especially considering how other network aware apps such as Pidgin use NetworkManager for this very same thing.
|
04-29-2011, 11:17 PM | #10 |
Member
Posts: 20
Karma: 11190
Join Date: Mar 2011
Device: various
|
Sorry if I struck a nerve. That wasn't my intent at all.
Seriously, though. Why are you trying to determine network state using Network Manager? Since a good deal of your code seems to be in Python, shouldn't you be using the built-in, OS transparent tool set that comes with it instead? For example, from my copy of "Foundations of Python Network Programming" by John Goerzen: Code:
#!/usr/bin/env python # Simple server -Chapter 1 - server.py import socket host = '' # Bind to all interfaces port = 51423 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ... etc. ad nauseum Take a piece of well intentioned advice from a battle scarred veteran with three plus decades of experience doing network design, admin, and support: You really don't want to write OS specific code if at all possible. It's guaranteed to get you into trouble sooner rather than later. Trust me, you'll be a lot happier if you re-factor your networking code to get rid of any OS discovery/special handling that you may have written. Still aren't convinced? Ask yourself this: Just how much OS specific code is in the Apache source code? OpenLDAP? PHP? Postgres? Mysql? How much of that OS specific code is geared toward solving networking issues? Last edited by sgtrock; 04-29-2011 at 11:20 PM. |
04-29-2011, 11:22 PM | #11 |
creator of calibre
Posts: 43,849
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The point is not to determine if a network interface is up, the point is to determine if the user has enabled his internet connection. And this is so that the news scheduler can suspend itself until the user re-enables the network connection. Otherwise scheduled downloads will fail and the scheduler will give up on them for the day.
If you dont want to use networkmanager, simply disable/uninstall it, then calibre will not use it to check for anything. And I have no idea what you believe the code you've posted will accomplish? It will work even if only the loopback interface is up. |
10-13-2013, 07:37 AM | #12 |
Junior Member
Posts: 9
Karma: 10
Join Date: May 2011
Device: Non
|
I know I'm resurrecting a thread, but it's relevant.
I'm using Linux Mint (IE effectively Ubuntu) and getting the same 'not connected to the internet error'. If I remove Network Manager, will it mess up other programs such as Pidgin? |
10-14-2013, 12:26 AM | #13 |
creator of calibre
Posts: 43,849
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If it does cause problems, simply re-install it.
|
10-15-2013, 11:21 AM | #14 |
Junior Member
Posts: 9
Karma: 10
Join Date: May 2011
Device: Non
|
Thanks for the reply. You're saying that Calibre can't work if Ubuntu needs Network Manager, in effect.
I'm sticking with Network Manager as I don't have the time or technical nous to risk having to sort out my net connection. I'll just have to live with Calibre not working properly till this bug is fixed. |
10-15-2013, 11:25 AM | #15 | |
Well trained by Cats
Posts: 29,790
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
And Calibre does work with NM on some systems. This appears to be a distro module combination compatibility issue, not a 'bug' |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] ubuntu 0.6.46 ERROR: No internet connection | bigreat | Calibre | 16 | 04-09-2013 06:03 PM |
No internet connection | the_dave | Calibre | 0 | 03-03-2011 01:03 PM |
Error: No Internet connection | fueg0 | Calibre | 9 | 10-08-2010 04:02 AM |
ERROR: No internet connection | nicois | Calibre | 3 | 09-20-2010 11:07 AM |
Wireless internet connection frustrating IDS connection | Socrates | iRex | 8 | 10-21-2009 12:46 PM |