suspend/audio_before_suspend always fails: pa_context_connect() failed: Connection refused

Bug #1904707 reported by Leon Liao
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Won't Fix
High
Yao Wei

Bug Description

The suspend/audio_before_suspend test case always fails.
Looks there are some thing wrong in pulseaudio.
But, we run this test case on different machines and got the same result.

[I/O log]
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
Traceback (most recent call last):
  File "/tmp/nest-j81t0lps.3361f09f54625130ca8353599d2d0b04ec843608119aba04070f3a0948f151e7/audio_settings.py", line 9, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/checkbox_support/scripts/audio_settings.py", line 368, in main
    store_audio_settings(settings_file)
  File "/usr/lib/python3/dist-packages/checkbox_support/scripts/audio_settings.py", line 218, in store_audio_settings
    pactl_status = check_output(["pactl", "info"],
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pactl', 'info']' returned non-zero exit status 1.

Related branches

Leon Liao (lihow731)
tags: added: oem-priority originate-from-1904501 somerville
tags: added: originate-from-1904682
tags: added: originate-from-1901522
tags: added: originate-from-1904111
tags: added: originate-from-1904143
Leon Liao (lihow731)
Changed in oem-priority:
importance: Undecided → High
Changed in plainbox-provider-checkbox:
importance: Undecided → High
Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

per check, this failed on the I+N machine but not the UMA machine.

Per further investigation, the window on the screen does not have the desktop DBUS session. I think it can't access the pulseaudio session, too.

I suspect that's the root cause.

Revision history for this message
Alex Tu (alextu) wrote :

more information followed #1,
The `pactl info` failed on the terminal opened by checkbox.

To manually open a new terminal then `pactl info` works on the new terminal.
The `pactl info` failure could be caused by the terminal environment created by the checkbox.

Cyrus Lien (cyruslien)
tags: added: originate-from-1903251
Leon Liao (lihow731)
tags: added: originate-from-1905838
Revision history for this message
Jonathan Cave (jocave) wrote :

I'm sure I encountered this problem while adding ODM Cert testing to the CDTS snap. I think it required some additional environment setup, I'll see if I can dig out the info on what I did.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

did you run checkbox as root?

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Please redo the same test using checkbox remote

Changed in plainbox-provider-checkbox:
status: New → Incomplete
Revision history for this message
Jonathan Cave (jocave) wrote :

This does indeed depend on how checkbox was run and the environment setup. I believe this was the change I made to ensure it works in checkbox snaps for classic systems: https://code.launchpad.net/~jocave/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/388884

Correct setup of PULSE_RUNTIME_PATH is key.

Leon Liao (lihow731)
tags: added: originate-from-1907027
Leon Liao (lihow731)
tags: added: originate-from-1907039
Changed in oem-priority:
importance: High → Critical
tags: added: originate-from-1904157
Changed in oem-priority:
importance: Critical → High
Revision history for this message
Lukas Waymann (meribold) wrote :
Revision history for this message
Jonathan Cave (jocave) wrote :

As SRU is run using Checkbox Remote and these are "normal user" jobs, I believe they will be susceptible to the problems surrounding setup of the environment for jobs as described in this card: https://trello.com/c/k15lSgfj

As a result, I expect that things like lack of setup of variables like PULSE_RUNTIME_PATH is to blame.

tags: added: originate-from-1908663
Revision history for this message
Lukas Waymann (meribold) wrote :
jeremyszu (os369510)
tags: added: originate-from-1909204 stella
tags: added: originate-from-1909449
jeremyszu (os369510)
tags: added: originate-from-1909716
Cyrus Lien (cyruslien)
tags: added: originate-from-1910714
Cyrus Lien (cyruslien)
tags: added: originate-from-1904977
tags: added: originate-from-1909557
tags: added: originate-from-1910653
tags: added: originate-from-1912128
Cyrus Lien (cyruslien)
tags: added: originate-from-1912744
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Fixed after January stable deb release.

See <Cert_Jenkins_URL>/job/cert-stock-sru-focal-desktop-inspiron-7591-c2-26881/6/testReport/junit/com.canonical/certification__suspend_audio_before_suspend/

Changed in plainbox-provider-checkbox:
status: Incomplete → Fix Released
Changed in oem-priority:
status: New → Fix Released
jeremyszu (os369510)
tags: added: originate-from-1914177
Cyrus Lien (cyruslien)
tags: added: originate-from-1914705
jeremyszu (os369510)
tags: added: originate-from-1914721 sutton
jeremyszu (os369510)
Changed in oem-priority:
assignee: nobody → jeremyszu (os369510)
status: Fix Released → In Progress
Revision history for this message
jeremyszu (os369510) wrote :

$ apt policy plainbox-provider-checkbox
plainbox-provider-checkbox:
  Installed: 0.57.0+git202103031045+pkg160~ubuntu20.04.1
  Candidate: 0.57.0+git202103031045+pkg160~ubuntu20.04.1
  Version table:
 *** 0.57.0+git202103031045+pkg160~ubuntu20.04.1 500
        500 http://ppa.launchpad.net/checkbox-dev/ppa/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

Still can reproduce this issue.

Revision history for this message
jeremyszu (os369510) wrote :

@Sylvain,

Hi, I try it with version "0.57.0+git202103031045+pkg160~ubuntu20.04.1", still get the same error. Would you please help to take a look?

tags: added: originate-from-1917836
Changed in plainbox-provider-checkbox:
status: Fix Released → New
Changed in oem-priority:
status: In Progress → Triaged
jeremyszu (os369510)
tags: added: originate-from-1918126
jeremyszu (os369510)
tags: added: originate-from-1918246
jeremyszu (os369510)
tags: added: originate-from-1918652
tags: added: originate-from-1918636
tags: added: originate-from-1918629
jeremyszu (os369510)
tags: added: originate-from-1919334
Cyrus Lien (cyruslien)
tags: added: originate-from-1919992
tags: added: originate-from-1914340
Cyrus Lien (cyruslien)
tags: added: originate-from-1923579
Cyrus Lien (cyruslien)
tags: added: originate-from-1910385
jeremyszu (os369510)
tags: added: originate-from-1924711
jeremyszu (os369510)
tags: added: originate-from-1926744
jeremyszu (os369510)
tags: added: originate-from-1927355
Andy Chi (andch)
tags: added: originate-from-1928663
tags: added: originate-from-1913010
jeremyszu (os369510)
tags: added: originate-from-1929282
Bin Li (binli)
tags: added: originate-from-1930217
Andy Chi (andch)
tags: added: originate-from-1921363
You-Sheng Yang (vicamo)
tags: added: originate-from-1930846
Andy Chi (andch)
tags: added: originate-from-1931423
jeremyszu (os369510)
tags: added: originate-from-1934271
Yao Wei (medicalwei)
tags: added: originate-from-1930226
Dirk Su (dirksu)
tags: added: originate-from-1937366
Yao Wei (medicalwei)
Changed in oem-priority:
assignee: jeremyszu (os369510) → Yao Wei (medicalwei)
Revision history for this message
Yao Wei (medicalwei) wrote :

This issue seems to be that the terminal session cannot use pulseaudio session due to wrong $XDG_RUNTIME_DIR that happens after a reboot due to GPU switching.

p-p-c maintainers say that using checkbox remote would avoid the problem and they recommend us to migrate:
https://code.launchpad.net/~medicalwei/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/405995

Tested that running the following test cases in order:
- com.canonical.certification::graphics/1_auto_switch_card_UHD_Graphics_630__Mobile_
- com.canonical.certification::suspend/audio_after_suspend_auto

This would fail on local and pass on remote.

Closing this as wontfix and we should use checkbox remote for testing.

Also note that Sylvain Pineau says they are killing pm_test.py. We might need to update our script that uses pm_test.py for poweroff and reboot.

Changed in oem-priority:
status: Triaged → Won't Fix
Changed in plainbox-provider-checkbox:
status: New → Won't Fix
Revision history for this message
jeremyszu (os369510) wrote :

According to comment#13, SWE needs to prevent to use local sanity since it's not longer support.
It's confirmed by AlexTu and Sylvain.
Cert team will retire local sanity and local sanity will not longer maintain.

Andy Chi (andch)
tags: added: originate-from-1944836
Dirk Su (dirksu)
tags: added: originate-from-1944821
no longer affects: plainbox-provider-checkbox
Dirk Su (dirksu)
tags: added: originate-from-1945615
Dirk Su (dirksu)
tags: removed: originate-from-1945615
Andy Chi (andch)
tags: added: originate-from-1948413
Bin Li (binli)
tags: added: originate-from-1950718
Cyrus Lien (cyruslien)
tags: added: originate-from-1955096
Dirk Su (dirksu)
tags: added: originate-from-1955543
Bin Li (binli)
tags: added: originate-from-1956331
Andy Chi (andch)
tags: added: originate-from-1956738
Atlas Yu (pseudoc)
tags: added: originate-from-1995338
Cyrus Lien (cyruslien)
tags: added: originate-from-1939907
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.