Different api response in localhost and production server

Hi all:

I've modified a view into my localhost computer (added 3 new fields), synchronized the view with the remote server, uploaded all the generated files to the server (not only the new ones), rebuild the prod cache...

But when I call the API in my local computer, I get the right json answer, but in my production server, the new fields are not shown.

sql (same on both enviroments)

SELECT
p.id_proyecto AS id_proyecto,
u.codigo_responsable AS codigo_responsable,
u.DNI AS DNI,
CONCAT(
u.apellidos, ', ', u.nombre
) AS JdO,
u.color AS color,
p.delegacion AS delegacion,
p.estado AS estado,
p.descripcion AS descripcion,
p.fecha_actualizado AS fecha_actualizado
FROM
(
proyectos p
JOIN usuarios u ON(
u.codigo_responsable = p.codigo_responsable
AND u.codigo_responsable IS NOT NULL
AND u.codigo_responsable <> ''
AND u.codigo_responsable <> 'NA'
AND (
FIND_IN_SET('1', u.nivel)
OR FIND_IN_SET('4', u.nivel)
)
)
)

Localhost answer:

{
  "success": true,
  "action": "list",
  "proyectos_jdo": [
    {
      "id_proyecto": "M0302101/0006",
      "codigo_responsable": "60008",
      "DNI": "1111",
      "JdO": "Manuel",
      "color": "#f1c40f",
      "descripcion": "Proyecto Olayo",
      "delegacion": "M502",
      "estado": "Pedido",
      "fecha_actualizado": "2026-09-08T00:00:00+00:00"
    },
    {
      "id_proyecto": "M0302102/0006",
      "codigo_responsable": "60008",
      "DNI": "1111",
      "JdO": "Manuel",
      "color": "#f1c40f",
      "descripcion": "Viaje a Bilbao",
      "delegacion": "M502",
      "estado": null,
      "fecha_actualizado": "2026-09-08T00:00:00+00:00"
    }
  ],
  "totalRecordCount": 60568
}

Remote server:

{
  "success": true,
  "action": "list",
  "proyectos_jdo": [
    {
      "id_proyecto": "M0302101/0006",
      "codigo_responsable": "60008",
      "DNI": "1111",
      "JdO": "Manuel",
      "color": "#f1c40f",
      "descripcion": "Proyecto Olayo"
    },
    {
      "id_proyecto": "M0302102/0006",
      "codigo_responsable": "60008",
      "DNI": "111",
      "JdO": " Manuel",
      "color": "#f1c40f",
      "descripcion": "Viaje a Bilbao"
    }
  ],
  "totalRecordCount": 60568
}

As you can see, the 'delegacion', 'estado' and 'fecha_actualizado' fields, are not shown. (they are the new added fields in my sql sentence)

If I run the sql sentence (heidisql) in production server, these fields are shown.

If I go to "proyectosJdOList" the fields are shown...

Any ideas? Thanks in advance

Any ideas?

You may read Clearing Symfony Cache.

1 Like

Hi arbei:

As always, thanks a lot for your answer

I'm afraid I've done the clearing cache step (is what I meant with rebuild the prod cache...)

Delete var\cache\fields on your production server.

Same result :face_exhaling:

Then you better try delete all files from your server and upload again to make sure new files are used.

Thanks again, that's the first thing I did.

I've found the problem, after clearing cache, sometimes I can't access my web, so I checked the logs and I saw:
Uncaught Exception: Unable to write in the "cache" directory (/home/semi/web/domain/public_html/var/cache/prod).',

so the problem was there was some folders with owner root and other with owner "semi".

After repair the permissions and restart the cache, now everything is OK.

THANKS A LOT¡¡¡