Cannot upload file pixelfed 0.12.3~ynh1

Hello, did install Pixelfed without issues, did create a admin, and could log in. But i can upload files, i choose a file to upload, and nothing happen. I have seen in this forum that other had have some premission issues, but those should be patched now, did also try to run “yunohost app upgrade pixelfed --force” but i still do have the same issue. version is 0.12.3~ynh1.

3 Likes

Having the same issue on the same version on a fresh install. I caught the following in Firefox console:

Uncaught (in promise) 
Object { 
  stack: "N@https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1:3016833\n86425/Ie.xhr</</h/<@https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1:3030780\nh@https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1:3030925\n", 
  message: "Request failed with status code 500", 
  name: "AxiosError", 
  code: "ERR_BAD_RESPONSE", 
  config: Object { timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", … }, 
  request: XMLHttpRequest { readyState: 4, timeout: 0, withCredentials: false, … }, 
  response: Object { data: {…}, status: 500, statusText: "Internal Server Error", … } 
}

Network request details

XHRPOST
https://example.com/api/compose/v0/media/upload
[HTTP/2 500 Internal Server Error 148ms]

Database error, I think this is the biggest clue?

error 'SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "caption" of relation "media" violates not-null constraint\nDETAIL: Failing row contains (2, null, 729198241515671553, 1, public/m/_v2/729198241515671553/0e43b1202-69768b/nD57XxKZKUUy/tF..., null, null, null, null, 1, image/png, 619, null, null, 2024-08-14 05:08:20, 2024-08-14 05:08:20, null, null, null, 80886755e66219cbb3071b5b1a9a0f7797a190ad1b93f474f8c1660ed10650f5, null, null, null, null, null, null, null, f, 3, f, null, null, null, n…ll, null, null). (Connection: pgsql, SQL: insert into "media" ("status_id", "profile_id", "user_id", "media_path", "original_sha256", "size", "mime", "filter_class", "filter_name", "version", "updated_at", "created_at") values (?, 729198241515671553, 1, public/m/_v2/729198241515671553/0e43b1202-69768b/nD57XxKZKUUy/tFab8Z34uU9vybrQpPeQqRDmiJKgbsyu4vl1MsJF.png, 80886755e66219cbb3071b5b1a9a0f7797a190ad1b93f474f8c1660ed10650f5, 619, image/png, ?, ?, 3, 2024-08-14 05:08:20, 2024-08-14 05:08:20) returning "id")'

I tried running

ALTER TABLE media ALTER COLUMN caption DROP NOT NULL;

Which let me upload but the image was broken after doing so.

SweetAlert:

Uncaught (in promise) SweetAlert: 2nd argument ('undefined') is invalid
vendor.js:1:2562350
    throwErr https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
    d https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
    p https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
    getOpts https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
    forEach self-hosted:203
    getOpts https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
    s https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
    mediaUpload https://example.com/js/compose.chunk.47ba00abaa827b26.js:1
    (Async: promise callback)
    mediaUpload https://example.com/js/compose.chunk.47ba00abaa827b26.js:1
    forEach self-hosted:203
    mediaUpload https://example.com/js/compose.chunk.47ba00abaa827b26.js:1
    mediaWatcher https://example.com/js/compose.chunk.47ba00abaa827b26.js:1
    dispatch https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1
    handle https://example.com/js/vendor.js?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:1

Here’s what I’ve tried so far:

Logs
sudo journalctl -u pixelfed -f and
sudo tail -f /var/www/pixelfed/storage/logs/*.log

Didn’t find anything noteworthy…

PHP
Used sudo tail -f /var/log/php8.2-fpm.log and confirmed that PHP 8.2 was deployed correctly.

Permissions
Older posts on the forums suggested doing this, which did not work:

sudo chown -R www-data:www-data /var/www/pixelfed/storage
sudo chmod -R 775 /var/www/pixelfed/storage
df -h

I also tried yunohost app upgrade pixelfed --force like you tried above. No dice.

Interestingly, I am able to upload stories.

2 Likes

Yes, exacly the same here, stories work, but not uploading posts.

Any ideas guys?

No update on this @YunoHost ?

Same thing for me - can upload to stories, but normal posts it shows an upload bar briefly and then disappears. Looking at the console for browser it shows:

POST 500 (Internal Server Error)

1 Like

Yes, would be great with a fix to this one.

I too am having this issue and see no effort to repair it. The last updates in Github are about 4 months ago.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

I just had a quick look and I saw that a PR is open and seems related to the issue, so does this PR fixes your issue?

please make sure to have a proper backup before testing it!!

to install it:

sudo yunohost app upgrade pixelfed -u https://github.com/NorbiPeti/pixelfed_ynh/tree/master --debug --force

disclaimer: i don’t use pixelfed and i’m not used to php apps so i can’t help more than that

1 Like

That update fixed some of the issues. I can now see the feed and upload an avatar pic. However, when I go to upload a pic for a posting, I get the new upload dialog, it says it is uploading, then returns to the upload screen with no way to move forward with posting.

1 Like

Do you have any logs ?

I’ll install an instance to see if I can debug this shit, but not today as I’m tired and tomorrow I’ve an appointment

1 Like

Did install the debug version, still have the same upload error. This ih my output from the log file:

tail -f /var/www/pixelfed/storage/logs/*.log

#62 /var/www/pixelfed/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#63 /var/www/pixelfed/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#64 /var/www/pixelfed/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#65 /var/www/pixelfed/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\HandleCors->handle()
#66 /var/www/pixelfed/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#67 /var/www/pixelfed/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Pipeline\Pipeline->then()
#68 /var/www/pixelfed/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#69 /var/www/pixelfed/public/index.php(56): Illuminate\Foundation\Http\Kernel->handle()
#70 {main}
"}

found the bug, the workaround is on its way

fyi it’s an upstream bug: Image uploads not working, SQLSTATE not null violation with Postgresql · Issue #5217 · pixelfed/pixelfed · GitHub

2 Likes

(This is two hours old!?? I’m so happy, I was interested in Pixelfed as an ActivityPub software, and I just learned it was working in YunoHost because of this thread!! Thank you so much for coming back, reporting fixes and doing research, @OniriCorpe !! <3 Good dog!! :slight_smile: )

1 Like

Should be working with 0.12.3~ynh2 ^w^

1 Like

Yes, did now install 0.12.3~ynh2, seems i still have the same issue?

I did just install it from GitHub - YunoHost-Apps/pixelfed_ynh: The federated image shareing service Pixelfed for YunoHost, but not the testing branch.

Did try to install the testing --debug brach, seems still to have that issue, not being able to upload posts, but stories does work just fine!

UPDATE: did uninstall a few times and reinstalled, and seems to work for me now!! THANKS!
Pixelfed is a really nice app, easy to get new users to it!

For anyone encountering issues with upgrading Pixelfed with this fix, this method worked for me:

  1. Install Pixelfed using the YunoHost web UI.

  2. Run the following command to upgrade to the latest testing branch:

    sudo yunohost app upgrade pixelfed -u https://github.com/YunoHost-Apps/pixelfed_ynh/tree/testing --debug --force
    
  3. (Optional) After successfully upgrading to the testing branch, you should be able to revert back to the main branch with the fixes installed:

    sudo yunohost app upgrade pixelfed -u https://github.com/YunoHost-Apps/pixelfed_ynh/tree/master --force
    
1 Like