# portsnap issues for a few days



## breefsd (Feb 5, 2014)

Hello, 

I have been facing problems for a few days with my daily cron script using `portsnap`
I have this on FreeBSD 9.1 as well as 9.2 (release).

I encountered this issue twice for less than a week, and all the hosts were affected (fetching over 20000):

```
Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Tue Feb 4 00:28:48 CET 2014 to Wed Feb 5 00:43:34 CET 2014.
Fetching 4 metadata patches... done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Fetching 24725 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150....160....170....180....190....200....210....220....230....240....250....260....270....280....290....300....310....320....330....340....350....360....370....380....390....400....410....420....430....440....450....460....470....480....490....500....510....520....530....540....550....560....570....580....590....600....610....620....630....640....650....660....670....680....690....700....710....720....730....740....750....760....770....780....790....800....810....820....830....840....850....860....870....880....890....900....910....920....930....940....950....960....970....980....990....1000....1010....1020....1030....1040....1050 done.
Applying patches... done.
Fetching 23691 new ports or files... snapshot is corrupt.
```

In my daily script I do this:
`portsnap cron`
`portsnap update`

I can repair it with `rm /var/db/portsnap/tag && portsnap fetch extract`, but usually I don't have any problem with that.
Is there something suspect?

Thanks.


----------



## trh411 (Feb 5, 2014)

Per portsnap(8), running `portsnap update` from cron(8) is a bad idea:

```
o   Running portsnap update from cron(8) is a bad idea -- if you are ever
         installing or updating a port at the time the cron job runs, you will
         probably end up in a mess when portsnap updates or removes files
         which are being used by the port build.  However, running portsnap -I
         update is probably safe, and can be used together with portversion(1)
         to identify installed software which is out of date.
```
Could this be causing your problem?


----------



## kpa (Feb 5, 2014)

Try again with `portsnap fetch extract`. There was an issue with the snapshot builder that caused everything in the ports tree to be considered as updated and this error may be related to the issue.


----------



## breefsd (Feb 5, 2014)

> if you are ever installing or updating a port at the time the cron job runs


No sure that's not the problem here, I would say in portsnap() that trying to do such a thing would be the bad idea first.



> There was an issue with the snapshot builder that caused everything in the ports tree to be considered as updated


It looks so:

```
Fetching 23691 new ports or files
```

`portsnap fetch extract` did solved the problem, but I had to use this twice in a few days. I hope you are right.

Thanks for your replies.


----------

