# Bug with psconvert? gmt begin \<name\> png fails, but gmt begin \<name\> png,ps works

**URL:** <https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423>\
**Category:** Q&A\
**Created:** [June 4, 2026, 5:43pm UTC](https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423 "2026-06-04T17:43:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [June 4, 2026, 5:43pm UTC](https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423/1 "2026-06-04T17:43:52Z")

</div>

Hi,

I recently reinstalled my operating system (Kubuntu 26.04) and noticed a strange issue with GMT.

The following script works as expected:

```auto
gmt begin 3 png,ps
    gmt basemap -R0/1/0/1 -Baf
gmt end

```

However, if I remove the `ps` format:

```auto
gmt begin 3 png
    gmt basemap -R0/1/0/1 -Baf
gmt end

```

I get the following error:

```auto
Error: /undefinedfilename in (/home/esteban82/.gmt/sessions/gmt_session.43357/gmt_0.ps-)

Last OS error: Permission denied

psconvert [ERROR]: System call [gs -q -dNOSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -DPSL_no_pagefill -dMaxBitmap=2147483647 -dUseFastColor=true '/home/esteban82/.gmt/sessions/gmt_session.43357/gmt_0.ps-' 2> '/home/esteban82/.gmt/sessions/gmt_session.43357/psconvert_43374c.bb'] returned error 256.

end [ERROR]: Failed to call psconvert
end [ERROR]: gmtinit_process_figures returned error 79

```

Has anyone seen this before? Could this be related to Kubuntu 26.04, Ghostscript, file permissions, or a GMT configuration issue introduced during the OS reinstall?

gmt version: 6.7.0\_7b70493\_2026.06.01  
gs version: 10.06.0

Any suggestions on what I should check would be appreciated.

Thanks,  
Federico

---

<div class="post-metadata">

**Author:** ![jjg](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/jjg/32/2822_2.png) [@jjg](https://forum.generic-mapping-tools.org/u/jjg)\
**Post date:** [June 5, 2026, 10:04am UTC](https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423/2 "2026-06-05T10:04:47Z")

</div>

My first guess would be to `ls -lR /home/esteban82/.gmt/` to see if anything is owned by root, this might be the case if you accidentally run a script under `sudo` …

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [June 5, 2026, 10:08am UTC](https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423/3 "2026-06-05T10:08:31Z")

</div>

A Linux Mint user here  
Not confirming the issue  
gmt 6.3.0 (system) and 6.6.0 (conda/mamba), gs 9.55.0 or 10.04.0, respectively. All good.

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [June 5, 2026, 10:12am UTC](https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423/4 "2026-06-05T10:12:01Z")

</div>

Maybe try running `gmt end -Vd` to check verbose/debug output?

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [June 5, 2026, 4:09pm UTC](https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423/5 "2026-06-05T16:09:54Z")

</div>

The error is saying that the syscall to gs has no rights to write in `/home/esteban82/.gmt/sessions/gmt_session.43357` but this cannot (??) be a permissions problem because the file `gmt_0.ps-` was already created. So … no idea.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [June 8, 2026, 9:40pm UTC](https://forum.generic-mapping-tools.org/t/bug-with-psconvert-gmt-begin-name-png-fails-but-gmt-begin-name-png-ps-works/6423/6 "2026-06-08T21:40:27Z")

</div>

I managed to solve (at least temporary) the issue. According to ChatGPT this was the issue and the solution:

> The issue was not related to GMT, file permissions, or Ghostscript itself. Ghostscript was unable to open GMT’s temporary PostScript files located in `~/.gmt/sessions`, even though the files existed and had the correct permissions.
> 
> The root cause was AppArmor. The kernel logs showed that the `gs` profile was denying read access to files such as:
> 
> `~/.gmt/sessions/gmt_session.xxxxx/gmt_0.ps-`
> 
> This caused Ghostscript to fail with:
> 
> `Error: /undefinedfilename`  
> `Last OS error: Permission denied`
> 
> The problem was confirmed by copying the PostScript file to `/tmp`, where Ghostscript processed it successfully.
> 
> The solution was to relax or disable the AppArmor profile for Ghostscript (`gs`), or modify the profile to allow access to the GMT session directory.
