Hi Louise,
Thank you for your reply. I don't think it is a permissions issue.
My user has write access in that folder.
deploy@alaveteli:/srv/www/current$ ls -la
/srv/www/releases/20160420203445/cache/attachments_production
total 88
drwxr-xr-x 20 deploy deploy 4096 Apr 21 18:52 .
drwxrwxr-x 4 deploy deploy 4096 Apr 21 00:02 ..
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 0d6
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 17c
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 1ac
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 200
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 224
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 69e
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 75e
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 7f4
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 8e6
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 91d
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 9dc
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 a8e
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 aaa
drwxr-xrwx 401 deploy deploy 12288 Feb 2 19:15 attachments_production
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 b68
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 c99
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 e2c
drwxrwxr-x 2 deploy deploy 4096 Apr 21 18:52 eb7
I will check the class you suggested.
Andrei Petcu
On 04/21/2016 06:43 PM, Louise Crow wrote:
> Hi Andrei,
>
> It looks as though the indexing process it trying to regenerate a cached
> attachment file on the filesystem in order to index it. The filename for
> this cached attachment is generated by the FoiAttachment class based on
> a hexdigest of the contents of the attachment [1]. As the email parsing
> code in Alaveteli has changed over time, it may be that the exact
> hexdigest will not be the same as the one that was generated on your
> original server with a previous version of the code. However, if you set
> the permissions for the attachments_production directory such that it is
> writable by the application user (who should also be the user running
> the indexing), then an equivalent cached attachment file should be
> created, allowing the indexing to proceed.
>
> Cheers
>
> Louise
>
> [1]
>
https://github.com/mysociety/alaveteli/blob/develop/app/models/foi_attachment.rb#L38
>
> On 19 April 2016 at 19:43, Andrei Cristian Petcu <
and...@ceata.org
> <mailto:
and...@ceata.org>> wrote:
>
> Hi,
>
> I am restoring my data from my current production server to a test
> server and when I run the rebuild_index command I get an error.
>
> RAILS_ENV=production bundle exec rake xapian:rebuild_index
> models='InfoRequestEvent' verbose=true --trace &>
> /tmp/rebuild_xapian_issue.txt
>
> The error:
>
https://my.owndrive.com/index.php/s/H3PjjYCrb81vxdX
>
> The strange thing is that I do not have a directory on my production
> server or on my testing server with that name
> (/srv/www/releases/20160417215801/cache/attachments_production/a8e).
> Where is Xapian trying to get it from? All the directory structure
> exists except for a8e.
>
> Thank you,
> Andrei Petcu
>
> --
> You received this message because you are subscribed to the Google
> Groups "Alaveteli Dev" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to
alaveteli-de...@googlegroups.com
> <mailto:
alaveteli-dev%2Bunsu...@googlegroups.com>.
> --
> You received this message because you are subscribed to the Google
> Groups "Alaveteli Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
alaveteli-de...@googlegroups.com
> <mailto:
alaveteli-de...@googlegroups.com>.