Cannot open a terminal now [SOLVED]

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Cannot open a terminal now [SOLVED]

Post by EdB »

Subject says it all. The gnome terminal that is standard with Linux Mint does not open now. I cannot open it from the panel, from the menu, or from nemo "Open in terminal". Something changed, I do not know what. I was not doing anything exotic, except maybe testing TeamViewer. I also remember installing x11vnc. I cannot remember the last terminal I opened, but it was certainly not very long ago, as you tend to live in those things in Linux.
I tried to roll back to an earlier state in TimeShift (today at noon) but that has not restored it. I also tried removing and reinstalling gnome terminal, likewise without result.

I am able to open xterm, for what that is worth. But I want my gnome terminal back, dammit!

ADDITIONAL INFO: If I run 'gnome-terminal' from xterm, I get "Couldn't register with accessibility bus: did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. # Error construction proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29509
Joined: Wed Jul 06, 2011 3:58 am

Re: Cannot open a terminal now

Post by xenopeek »

Since having this issue, have you restarted your system? If not then give that a try.

Gnome Terminal doesn't store any files in home directory (that I know of) but it does use gsettings that is stored there. Installing/removing packages, or rolling back to a Timeshift snapshot, only affects files in system directories. So you might try resetting Gnome Terminal's gsettings. With a functioning terminal you can do that with these commands:

Code: Select all

gsettings reset-recursively org.gnome.Terminal.ProfilesList
gsettings reset-recursively org.gnome.Terminal.Legacy.Settings
If the commands work there will be no feedback. In case of a problem it gives feedback about the problem.

Otherwise try starting gnome-terminal -v (-v adds verbosity, perhaps showing more info on the error?) from xterm again and immediately following it giving you that error message do echo $? to get the exit status. There are some known exit statuses documented here: https://wiki.gnome.org/Apps/Terminal/FA ... s_to_start

If that doesn't provide further info, see if there is anything more in the journal. Suggest to:
- Open 2 xterm windows
- In the first run journalctl -f to start following the journal
- In the second run gnome-terminal -v and wait for it to throw the error and exit
- Switch back to the first xterm and do Ctrl+C to interrupt the journal; from what the journal command printed, is there anything about Gnome Terminal?
Risking losing context you might also find that info with journalctl --no-pager -b -g gnome.terminal but this will only show journal message mentioning gnome terminal so I'd try above instead.
Image
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

I have restarted, several times.
I do remember accidentally killing xorg around the time this first showed up. Any possible relation?

ADDITIONAL INFO: If I run 'gnome-terminal' from xterm, I get
"Couldn't register with accessibility bus: did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. # Error construction proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached."

I can start a gnome terminal from xterm by 'sudo gnome-terminal'. but that just verifies that that it's still there.
One suggestion was to
chown -R user.user /home/user
as it seems to be a permissions-related issue.

I haven't done any of these yet, will wait till later in the morning. Too early to think right now:)
User avatar
xenopeek
Level 25
Level 25
Posts: 29509
Joined: Wed Jul 06, 2011 3:58 am

Re: Cannot open a terminal now

Post by xenopeek »

You've confirmed your issue I think. You should never run your terminal as root; only use sudo within the shell. Likely you changed ownership of relevant files in your home directory to root and you've only noticed this problem in Gnome Terminal thus far.

Correct command to remedy ownership would be following:
sudo chown -R $(id -u):$(id -g) ~
Image
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

Actually, I only tried the root terminal test AFTER the initial issue with gnome-terminal appeared. And I certainly did not execute any command. Just in and out.
Still, this is excellent knowledge and I appreciate it.
Looking forward to trying these ideas later.
User avatar
xenopeek
Level 25
Level 25
Posts: 29509
Joined: Wed Jul 06, 2011 3:58 am

Re: Cannot open a terminal now

Post by xenopeek »

I meant that as it runs with sudo, it looks like some files it needs in your home directory when running as yourself can't be accessed. Likely they were previously changed from you owning them to root owning them and that's why it works when using sudo. How/who/when/where will be hard to pin down except to note you must have run some GUI program as root or something else run as root changed file ownership.
Image
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

xenopeek wrote: Mon Oct 08, 2018 7:45 am You've confirmed your issue I think. You should never run your terminal as root; only use sudo within the shell. Likely you changed ownership of relevant files in your home directory to root and you've only noticed this problem in Gnome Terminal thus far.

Correct command to remedy ownership would be following:
sudo chown -R $(id -u):$(id -g) ~
Well, unfortunately this did not work.

I created another user, logged in as that person, and that user can open his gnome-terminal just fine. But my original account cannot. I logged in and out several times, rebooted, etc., still no success.

Attempt to start from xterm, get
Error construction proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0:
Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached.
gm10

Re: Cannot open a terminal now

Post by gm10 »

EdB wrote: Mon Oct 08, 2018 9:10 am Attempt to start from xterm, get
Error construction proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0:
Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached.
Try

Code: Select all

LC_ALL=C gnome-terminal
Also if that's not it, we need the full return status from the logs:

Code: Select all

grep terminal /var/log/syslog
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

gm10 wrote: Mon Oct 08, 2018 9:26 am
EdB wrote: Mon Oct 08, 2018 9:10 am Attempt to start from xterm, get
Error construction proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0:
Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached.
Try

Code: Select all

LC_ALL=C gnome-terminal
Also if that's not it, we need the full return status from the logs:

Code: Select all

grep terminal /var/log/syslog
LC_ALL gives this:
Couldn't register with accessibility bus: did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken

This is a section of the syslog where I try to start gnome-terminal from the panel:
Oct 8 08:37:17 ed dbus-daemon[1411]: [session uid=1000 pid=1411] Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' requested by ':1.1842' (uid=1000 pid=10205 comm="/usr/bin/gnome-terminal.real " label="unconfined")
Oct 8 08:37:18 ed systemd[1229]: Starting GNOME Terminal Server...
Oct 8 08:37:18 ed systemd[1229]: gnome-terminal-server.service: Main process exited, code=exited, status=10/n/a
Oct 8 08:37:18 ed gnome-terminal-server[10208]: Unable to init server: Could not connect: Connection refused
Oct 8 08:37:18 ed gnome-terminal-server[10208]: Failed to parse arguments: Cannot open display:
Oct 8 08:37:18 ed systemd[1229]: gnome-terminal-server.service: Failed with result 'exit-code'.
Oct 8 08:37:18 ed systemd[1229]: Failed to start GNOME Terminal Server.
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Cannot open a terminal now

Post by Flemur »

"Couldn't register with accessibility bus: did not receive a ...
Error construction proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0:
LOL at those hi-falutin, useless error messages.

Try

Code: Select all

sudo dpkg-reconfigure gnome-terminal
sudo dpkg-reconfigure gnome-terminal-data
Although you already tried the fix for this, try this anyway

Code: Select all

find $HOME ! -user $USER
see if root owns stuff.

Edit:
try this!

Code: Select all

/usr/bin/gnome-terminal.real
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
gm10

Re: Cannot open a terminal now

Post by gm10 »

EdB wrote: Mon Oct 08, 2018 9:42 am Oct 8 08:37:18 ed systemd[1229]: Starting GNOME Terminal Server...
Oct 8 08:37:18 ed systemd[1229]: gnome-terminal-server.service: Main process exited, code=exited, status=10/n/a
Oct 8 08:37:18 ed gnome-terminal-server[10208]: Unable to init server: Could not connect: Connection refused
Oct 8 08:37:18 ed gnome-terminal-server[10208]: Failed to parse arguments: Cannot open display:
Ok, so as per the documentation for exit status 10:
Reason: gtk_init() failed. The most likely cause is that the connection to the display could not be opened, for example because the environment that gnome-terminal-server is started with lacks a DISPLAY setting. Consult your distribution's documentation on how to fix this. Note that is it not relevant to check the environment from a different terminal (e.g. xterm); what counts is the environment that the session dbus-demon passes to the processes it starts.
Off the top of my head I have no idea how you managed to get that last bit messed up. A blind guess would be to try:

Code: Select all

apt install --reinstall dbus-user-session
Log out and back in after that, then try again. If it's still not working, out of curiosity, in your xterm check that the DISPLAY variable actually exists (printenv DISPLAY) and then see if you can launch the gnome-terminal like this:

Code: Select all

dbus-launch gnome-terminal
That's not a solution, just to see how broken things are.
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »


Off the top of my head I have no idea how you managed to get that last bit messed up. A blind guess would be to try:

Code: Select all

apt install --reinstall dbus-user-session
Log out and back in after that, then try again. If it's still not working, out of curiosity, in your xterm check that the DISPLAY variable actually exists (printenv DISPLAY) and then see if you can launch the gnome-terminal like this:

Code: Select all

dbus-launch gnome-terminal
That's not a solution, just to see how broken things are.
This is extremely strange. When I run the reinstall dbus command, log out, and log back in, I am able to bring up a terminal successfully exactly ONE time and one time only. After that, the error is

Oct 8 09:08:47 ed systemd[1278]: Starting GNOME Terminal Server...
Oct 8 09:08:47 ed gnome-terminal-server[9151]: Unable to init server: Could not connect: Connection refused
Oct 8 09:08:47 ed gnome-terminal-server[9151]: Failed to parse arguments: Cannot open display:
Oct 8 09:08:47 ed systemd[1278]: gnome-terminal-server.service: Main process exited, code=exited, status=10/n/a
Oct 8 09:08:47 ed systemd[1278]: gnome-terminal-server.service: Failed with result 'exit-code'.
Oct 8 09:08:47 ed systemd[1278]: Failed to start GNOME Terminal Server.

There are also many entries in the syslog like this:
Oct 8 09:04:01 ed at-spi2-registr[7576]: AT-SPI: Cannot open default display
Oct 8 09:04:01 ed at-spi-bus-launcher[5573]: dbus-daemon[5580]: Activating service name='org.a11y.atspi.Registry' requested by ':1.145' (uid=1000 pid=6043 comm="/usr/bin/python3 /usr/bin/cinnamon-killer-daemon " label="unconfined")
Oct 8 09:04:01 ed cinnamon-session[5650]: WARNING: t+77.39827s: AT-SPI: Could not obtain desktop path or name
Oct 8 09:04:01 ed at-spi2-registr[7578]: Could not open X display
Oct 8 09:04:01 ed at-spi-bus-launcher[5573]: dbus-daemon[5580]: Successfully activated service 'org.a11y.atspi.Registry'
Oct 8 09:04:01 ed at-spi-bus-launcher[5573]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Last edited by EdB on Mon Oct 08, 2018 10:26 am, edited 1 time in total.
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

Log out and back in after that, then try again. If it's still not working, out of curiosity, in your xterm check that the DISPLAY variable actually exists (printenv DISPLAY)

and then see if you can launch the gnome-terminal like this:

Code: Select all

dbus-launch gnome-terminal
That's not a solution, just to see how broken things are.
The printenv DISPLAY just gives this:
:0

The dbus-launch will start the gnome-terminal, but the message about the accessibility bus appears in the xterm window I use to launch.

By the way, I REALLY appreciate the help with this. This is how you learn this stuff - by getting things really screwed up and having to fix them.
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

Flemur wrote: Mon Oct 08, 2018 9:43 am
"Couldn't register with accessibility bus: did not receive a ...
Error construction proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0:
LOL at those hi-falutin, useless error messages.

Try

Code: Select all

sudo dpkg-reconfigure gnome-terminal
sudo dpkg-reconfigure gnome-terminal-data
Although you already tried the fix for this, try this anyway

Code: Select all

find $HOME ! -user $USER
see if root owns stuff.

Edit:
try this!

Code: Select all

/usr/bin/gnome-terminal.real
Thanks, but no luck with the dpkg-reconfigure commands.
The find command shows no root users owning any of my files.
The gnome-terminal.real shows the previous messages about the accessibility bus and StartServiceByName.
gm10

Re: Cannot open a terminal now

Post by gm10 »

EdB wrote: Mon Oct 08, 2018 10:17 amThe dbus-launch will start the gnome-terminal, but the message about the accessibility bus appears in the xterm window I use to launch.
Ok, good, so if the dbus-launch command works, that means dbus as such works correctly, just the desktop session doesn't. Based on that, another semi-blind guess at a fix would be this:

Code: Select all

apt install --reinstall mint-meta-cinnamon cinnamon cinnamon-session cinnamon-session-common at-spi2-core
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

gm10 wrote: Mon Oct 08, 2018 10:26 am
EdB wrote: Mon Oct 08, 2018 10:17 amThe dbus-launch will start the gnome-terminal, but the message about the accessibility bus appears in the xterm window I use to launch.
Ok, good, so if the dbus-launch command works, that means dbus as such works correctly, just the desktop session doesn't. Based on that, another semi-blind guess at a fix would be this:

Code: Select all

apt install --reinstall mint-meta-cinnamon cinnamon cinnamon-session cinnamon-session-common at-spi2-core
Before I do this, let me point out one more very strange piece of behavior. I have done all the commands people have suggested so far. At some point, things *apparently* started working! Some combination of things got things in order, and I could open terminals in the usual fashion. However, if I reboot the problem reappears and I cannot open them anymore. That is, the fix does not persist with reboot.
BUT, if I then log out, log in as another user and open a terminal, then log out and back in as myself, then my terminals WORK!

Do you need further info, or should I just go ahead and run the command you have above?

Ed
gm10

Re: Cannot open a terminal now

Post by gm10 »

EdB wrote: Mon Oct 08, 2018 10:43 am BUT, if I then log out, log in as another user and open a terminal, then log out and back in as myself, then my terminals WORK!

Do you need further info, or should I just go ahead and run the command you have above?
No, but that's interesting. So it's an issue with your user profile? Try this instead (copy & paste)

Code: Select all

sudo chown -Rc $USER:$USER $HOME
and maybe also

Code: Select all

rm -rv ~/.dbus
(not sure if needed but you should probably re-log after the last one)
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

gm10 wrote: Mon Oct 08, 2018 10:49 am
EdB wrote: Mon Oct 08, 2018 10:43 am BUT, if I then log out, log in as another user and open a terminal, then log out and back in as myself, then my terminals WORK!

Do you need further info, or should I just go ahead and run the command you have above?
No, but that's interesting. So it's an issue with your user profile? Try this instead (copy & paste)

Code: Select all

sudo chown -Rc $USER:$USER $HOME
and maybe also

Code: Select all

rm -rv ~/.dbus
(not sure if needed but you should probably re-log after the last one)
This did not appear to make a difference. Thanks, though.
gm10

Re: Cannot open a terminal now

Post by gm10 »

You could still try the re-install commands I gave you above I guess but at this point I'll cede the floor to someone more knowledgeable about this particular issue. We identified what's wrong, but I don't know what causes it.
EdB
Level 3
Level 3
Posts: 140
Joined: Fri Jan 08, 2016 11:34 am

Re: Cannot open a terminal now

Post by EdB »

gm10 wrote: Mon Oct 08, 2018 11:06 am You could still try the re-install commands I gave you above I guess but at this point I'll cede the floor to someone more knowledgeable about this particular issue. We identified what's wrong, but I don't know what causes it.
Thanks for taking the time. I appreciate it so much!
Locked

Return to “Software & Applications”