errors - "The source has changed on disk"

I’m getting a strange error on

Failed to reuse files from previous run: The 'pull' step of 'snap-config' is out of date:
The source has changed on disk. 
To continue, clean that part's 'pull' step by running `snapcraft clean snap-config -s pull`.
Build failed

I’ve never seen this error before on the build server. I’ve seen this happen local, but then I usually just snapcraft clean and it seems to work again.
The full output of the build is here:


What is the source key’s value of your snap-config part?

Looking at the snapcraft.yaml referenced in the build log, the part in question is:

    plugin: dump
    source: ./snap/
        snap.ini: rel/couchdb/etc/snap.ini
        snap_run: rel/couchdb/bin/snap_run

Snapcraft writes some internal state data to the ./snap/.snapcraft directory in your project, which would look like a change to the source of your part. Either somewhere outside of ./snap, or a subdirectory of ./snap will probably fix the problem.

1 Like

Thank you! Moving these files to a subdirectory did indeed fix my problem. Is it considered bad practice to store files in the snap directory then?

Yes, however, @kyrofa is making the /snap/local directory available for this particular purpose but it still not into the stable release yet.

sanity checks: allow snap/local dir by kyrofa · Pull Request #2268 · snapcore/snapcraft

It’s not in stable, but it should still work today (that PR just enshrines it in tests). We prefer that part sources be stored outside the snap/ directory, but if you must put them in there, use snap/local/