On Fri, Jun 17, 2016 at 2:42 PM, Pavneet Arora <pavneet_arora@waroc.com> wrote:
Unfortunately, while the mtxrun command works for a shell user:

  $ mtxrun -script base --variables | grep cache
  resolvers       | lists |   env: $SELFAUTOPARENT/texmf-cache
  resolvers       | lists |   var: $SELFAUTOPARENT/texmf-cache
  resolvers       | lists |   exp: /opt/context/tex/texmf-cache
  resolvers       | lists |   res: /opt/context/tex/texmf-cache

the result is the same for www-data:

  $ sudo -u www-data bash -c ". /opt/context/tex/setuptex /opt/context/tex; mtxrun --script base --variables | grep cache"
  resolvers       | caches | fatal error: there is no valid writable cache path defined

I have to think that setuptex isn't able to set up the runtime
environment for www-data, somehow?


Is  texmf-cache writable by www-data ?
When logged as  www-data, the cache writable should  be the /home/www-data/luatex-cache/<..> folder, while the standard one is used as readonly folder

Just make a test: in www-data home 
# . /opt/context/tex/setuptex /opt/context/tex
then make a simple "Hello world" test.tex and  read the log.

--
luigi