Feature(s) impacted
Forest Admin is not working with every table that I have some active storage relationship. For example, this simple code makes the request for data fail. Removing the line makes Forest show all other columns.
class Deposit < ApplicationRecord
has_one_attached :receipt_image
end
Rails generated schema:
create_table "active_storage_attachments", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.uuid "record_id", null: false
t.datetime "created_at", null: false
t.uuid "blob_id", default: -> { "gen_random_uuid()" }, null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
Observed behavior
Forest Admin always returns a 500 status code and no data.
{ "status": 500, "error":" Internal Server Error" }
Expected behavior
Forest Admin to show my models that have attachments.
Failure Logs
In browser: { “status”:500, “error”:" Internal Server Error" }
In server logs: public_send(/opt/render/project/.gems/ruby/3.0.0/gems/activestorage-6.0.5/lib/active_storage/attached/one.rb:13)
…
Request Data
curl --request GET 'https://api.usekamba.com/forest/Deposit?timezone=America%2FSao_Paulo&fields[Deposit]=account_id%2Caccount_type%2Camount%2Ccompany_bank_account%2Ccreated_at%2Ccurrency%2Cexpires_at%2Cid%2Cpayment_method_id%2Cpayout_at%2Creceipt_image%2Creceipt_image_attachment%2Creceipt_image_blob%2Creceipt_image_url%2Cstatus%2Ctransaction_type%2Cupdated_at&fields[company_bank_account]=id&fields[receipt_image_attachment]=name&fields[receipt_image_blob]=id&page[number]=1&page[size]=15&sort=-id' \
--header 'Cf-Worker:onrender.com' \
--header 'Accept-Language:en-US,en;q=0.9' \
--header 'Priority:u=1, i' \
--header 'Dnt:1' \
--header 'Version:HTTP/1.1' \
--header 'Cdn-Loop:cloudflare; subreqs=1' \
--header 'Cf-Connecting-Ip:201.17.125.96' \
--header 'Authorization:******' \
--header 'X-Request-Start:1684922767423448' \
--header 'Cf-Ew-Via:15' \
--header 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36' \
--header 'Render-Proxy-Ttl:4' \
--header 'Host:api.usekamba.com' \
--header 'Referer:https://app.forestadmin.com/' \
--header 'Cf-Ipcountry:BR' \
--header 'Sec-Ch-Ua:"Chromium";v="113", "Not-A.Brand";v="24"' \
--header 'Cf-Visitor:{"scheme":"https"}' \
--header 'Accept-Encoding:gzip' \
--header 'Sec-Fetch-Site:cross-site' \
--header 'Sec-Fetch-Mode:cors' \
--header 'Sec-Ch-Ua-Platform:"macOS"' \
--header 'Sec-Ch-Ua-Mobile:?0' \
--header 'Cf-Ray:7cc4b95fc5452558-GIG' \
--header 'Sec-Fetch-Dest:empty' \
--header 'Origin:https://app.forestadmin.com' \
--header 'True-Client-Ip:201.17.125.96' \
--header 'X-Forwarded-For:201.17.125.96, 172.70.105.136' \
--header 'Accept:application/json' \
--header 'X-Forwarded-Proto:https' \
--header 'Content-Type:application/json' \
--cookie '__cf_bm=MHlGyoO_MBEvGkPpdYkA1yjOPIP2z6CU5sI53aDODoo-1684922122-0-AbtvCcyYQilqqEyDPJ8h0ryCgA2DK9K Sb9QATiX tyPi3Ydtdg67FccwfjFEb2rxYRBsZ/ vHDuBEd3WRD5qG8=;_cfuvid=ob_1lV2Vs7DU1kC_PajDxAoyPUxXmJCJeBOa6qrqfHg-1684922122086-0-604800000;'
Context
- Project name: kamba-web
- Team name: …
- Environment name: Production, Development, SANDBOX
- Agent (forest package) name & version:
gem 'forest_liana', '8.0.8'
- Database type: posgresql
- Recent changes made on your end if any: Any.
I really need your help here guys as one of our main features needs to validate user bank receipts and our non-technical team is having a lot of problems validating these user-uploaded receipts in the dashboard. So far we are using JetAdmin but I like Forest and don’t want to migrate just because of this situation.
Thank you.