Help debugging rejection by automated review

I have attempted to publish a snap which stages the public “ufw” snap. When I try to push to the store, I get rejected by the automated review with the following error:

package contains external symlinks: usr/lib/python3/dist-packages/ufw/pycache lint-snap-v2_external_symlinks

That path (“usr/lib/python3/dist-packages/ufw/pycache”) does not exist in my snap, but in the staged “ufw” snap (see line 39 of it’s snapcraft.yaml:

I’m wondering if anybody has any ideas on why the automatic review is detecting this? Or how I could hunt down the offending link?


1 Like

check your prime directory or look at /snap/<snapname>/current on a locally installed snap, if the link is really there, you can use an override-prime: scriptlet to rm it … like:

    override-prime: |
      snapcraftctl prime
      rm -rf usr/lib/python3/dist-packages/ufw/pycache

This worked! Thank you. I am still not sure I understand the issue. The link I removed from the prime directory was the following:

prime/usr/lib/python3/dist-packages/ufw/__pycache__ -> /var/snap/ufw/current/usr/lib/python3/dist-packages/ufw/__pycache__

The automatic review flagged this link as “external”, however the link target looks to be within the $SNAP directory. Perhaps I am misunderstanding the error.

My current issue is solved, but I’d love to get any additional thoughts on this so I can avoid it going forward. Thank you again!