baedert / corebird

Native Gtk+ Twitter Client
https://corebird.baedert.org
GNU General Public License v3.0
791 stars 78 forks source link

corebird-1.7.3 does not allow to publish a picture (ComposeTweetWindow.vala:248: Bad Request) #795

Closed goupildb closed 6 years ago

goupildb commented 6 years ago

On Debian Sid corebird-1.7.3 does not allow to publish a picture I create a tweet with this simple message : test I add a picture from my disk corebird valid it (it display a checkmark) I click on Send button but no tweet is send.

In console the messages are : (corebird:28255): corebird-WARNING : Could not send tweet: Bad Request (corebird:28255): corebird-WARNING : ComposeTweetWindow.vala:248: Bad Request

And when i click on the "write button" i find my previous message I did not have this problem with corebird 1.5.1

valac 0.36 is installed I had tested the debian package and then i had compiled corebird 1.7.3 : the result is the same.

baedert commented 6 years ago

Can't reproduce that here, adding images to tweets works fine

goupildb commented 6 years ago

Perhaps a problem with vala on Debian Sid. I have had some difficulties to install it with my package manager (synaptic) The source compilation was claiming vala, while the corebird (binary) package did not install it So i installed : valac-0.36-vapi (0.36.6-1) libvala-0.36-0 (0.36.6-1) libvala-0.36-dev (0.36.6-1)

baedert commented 6 years ago

vala is a compiler+bindings, so the already compiled binary doesn't need it.

goupildb commented 6 years ago

Today i have tested corebird-1.7.3 on MATE, Gnome and KDE : i have obtained the same result. I have renamed it's directory (~./config/corebird/) before launching it : i have obtained the same result. When i install corebird-1.5.1 it works fine. I don't understand.

baedert commented 6 years ago

Can you try taking this patch: https://paste.xinu.at/2L6/ and applying it locally, then recompiling and then running G_MESSAGES_DEBUG=corebird ./corebird and post the output you see when trying to tweet here?

goupildb commented 6 years ago

$ G_MESSAGES_DEBUG=corebird ./corebird (corebird:29838): corebird-DEBUG: Corebird.vala:208: startup

(corebird:29838): Gtk-WARNING **: Theme parsing error: style.css:20:13: The 'icon-shadow' property has been renamed to '-gtk-icon-shadow'

(corebird:29838): Gtk-WARNING **: Theme parsing error: style.css:231:16: The 'outline-radius' property has been renamed to '-gtk-outline-radius'

(corebird:29838): Gtk-WARNING **: Theme parsing error: style.css:237:19: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:29838): Gtk-WARNING **: Theme parsing error: style.css:238:25: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:29838): Gtk-WARNING **: Theme parsing error: style.css:243:36: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:29838): Gdk-CRITICAL **: gdk_window_get_window_type: assertion 'GDK_IS_WINDOW (window)' failed (corebird:29838): corebird-DEBUG: Creating stream for goupildb (corebird:29838): corebird-DEBUG: 0 Starting stream for goupildb (corebird:29838): corebird-DEBUG: Account.vala:505: Add 0 disabled_rts ids (corebird:29838): corebird-DEBUG: Account.vala:474: Add 0 blocked ids (corebird:29838): corebird-DEBUG: Account.vala:443: Add 0 muted ids (corebird:29838): corebird-DEBUG: Account.vala:399: Adding 11 friends... (corebird:29838): corebird-DEBUG: ComposeTweetWindow.vala:100: /home/goupil2/.config/corebird/image-favorites/Bottin.png Finished!

(corebird:29838): corebird-WARNING **: Could not send tweet: Bad Request

(corebird:29838): corebird-WARNING **: ComposeTweetWindow.vala:248: Bad Request (corebird:29838): corebird-DEBUG: ComposeTweetWindow.vala:250: Tweet sent.

When i click on the Tweet button, the messages really start after the "Adding 11 friends..." yes I know: I do not have many friends :)

baedert commented 6 years ago

Can you rebuild with latest master, which adds some debug info for this? I thought maybe the problem is that you try to upload a png file and most of my favorite images are jpg but that doesn't help either.

Vistaus commented 6 years ago

@baedert Not sure if it helps, but I have no problems composing tweets with PNG files on Solus. So IMHO that's not the problem here.

baedert commented 6 years ago

Yes. One of the commits fixes error reporting when uploading images though, so I hope the problem is just that there's an error when uploading the image, resulting in an invalid ID later; leading to a Bad Request error when trying to send the actual tweet.

goupildb commented 6 years ago

I have compiled this new version, then i launch the next command, without entering anything under Corebird, then I leave immediately (to see what are the initial messages) : ./corebird --gst-debug-level=9 2> debug_when_lauched.txt debug_when_lauched.txt (the last line is, i think, when i quit its interface)

Then i retry on a console with the next command, and i copy the new messages below 👍 $ ./corebird --gst-debug-level=9

(corebird:26749): corebird-WARNING : Could not send tweet: Bad Request (corebird:26749): corebird-WARNING : ComposeTweetWindow.vala:248: Bad Request

(corebird:26749): corebird-WARNING : Could not send tweet: Bad Request (corebird:26749): corebird-WARNING : ComposeTweetWindow.vala:248: Bad Request

The 1rst couple of messages is obtained with a png image, the next with a jpg image (it don't worked either)

baedert commented 6 years ago

Don't use --gst-debug-level, it just adds a whole bunch of output that's specific to gstreamer. You have to use G_MESSAGES_DEBUG=corebird for the corebird debug messages to appear.

goupildb commented 6 years ago

Ok, sorry. Does this command ( G_MESSAGES_DEBUG=corebird) works for launching an instance of local corebird (./corebird) ? Because i don't see more messages when i launch it before launching my local corebird (compiled yesterday) Any other idea of test ?

baedert commented 6 years ago

G_MESSAGES_DEBUG=corebird just sets an environment variable; the full command should be G_MESSAGES_DEBUG=corebird ./corebird.

goupildb commented 6 years ago

Thank you. I did not put the right command console.

$ G_MESSAGES_DEBUG=corebird ./corebird (corebird:10607): corebird-DEBUG: Corebird.vala:208: startup

(corebird:10607): Gtk-WARNING **: Theme parsing error: style.css:20:13: The 'icon-shadow' property has been renamed to '-gtk-icon-shadow'

(corebird:10607): Gtk-WARNING **: Theme parsing error: style.css:231:16: The 'outline-radius' property has been renamed to '-gtk-outline-radius'

(corebird:10607): Gtk-WARNING **: Theme parsing error: style.css:237:19: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:10607): Gtk-WARNING **: Theme parsing error: style.css:238:25: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:10607): Gtk-WARNING **: Theme parsing error: style.css:243:36: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:10607): Gdk-CRITICAL **: gdk_window_get_window_type: assertion 'GDK_IS_WINDOW (window)' failed (corebird:10607): corebird-DEBUG: Creating stream for goupildb (corebird:10607): corebird-DEBUG: 0 Starting stream for goupildb (corebird:10607): corebird-DEBUG: Account.vala:505: Add 0 disabled_rts ids (corebird:10607): corebird-DEBUG: Account.vala:474: Add 0 blocked ids (corebird:10607): corebird-DEBUG: Account.vala:443: Add 0 muted ids (corebird:10607): corebird-DEBUG: Account.vala:399: Adding 11 friends... (corebird:10607): corebird-DEBUG: ComposeTweetWindow.vala:314: Loading /mnt/DDprc/Fichiers/Commun/Doc perso en consultation/Fichiers Ooffice/Rédaction doc informatique/Twitter/Gearhead 1 (aka GearHead: Arena).jpg (corebird:10607): corebird-DEBUG: CbComposeJob.c:313: POST 1.1/media/upload.json (corebird:10607): corebird-DEBUG: ComposeTweetWindow.vala:100: /mnt/DDprc/Fichiers/Commun/Doc perso en consultation/Fichiers Ooffice/Rédaction doc informatique/Twitter/Gearhead 1 (aka GearHead: Arena).jpg Finished! (corebird:10607): corebird-DEBUG: CbComposeJob.c:399: POST 1.1/statuses/update.json?media_ids=1775726593&status=test&auto_populate_reply_metadata=true

(corebird:10607): corebird-WARNING **: Could not send tweet: Bad Request

(corebird:10607): corebird-WARNING **: ComposeTweetWindow.vala:248: Bad Request (corebird:10607): corebird-DEBUG: ComposeTweetWindow.vala:250: Tweet sent.

It write "Tweet sent." but no tweet is sent.

Vistaus commented 6 years ago

I see that the path that contains the image contains spaces and the file name contains parentheses. Could it be that Corebird has trouble with such kind of paths/file names?

goupildb commented 6 years ago

I made another try with a more simplify path :

$ G_MESSAGES_DEBUG=corebird ./corebird (corebird:19997): corebird-DEBUG: Corebird.vala:208: startup

(corebird:19997): Gtk-WARNING **: Theme parsing error: style.css:20:13: The 'icon-shadow' property has been renamed to '-gtk-icon-shadow'

(corebird:19997): Gtk-WARNING **: Theme parsing error: style.css:231:16: The 'outline-radius' property has been renamed to '-gtk-outline-radius'

(corebird:19997): Gtk-WARNING **: Theme parsing error: style.css:237:19: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:19997): Gtk-WARNING **: Theme parsing error: style.css:238:25: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:19997): Gtk-WARNING **: Theme parsing error: style.css:243:36: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:19997): Gdk-CRITICAL **: gdk_window_get_window_type: assertion 'GDK_IS_WINDOW (window)' failed (corebird:19997): corebird-DEBUG: Creating stream for goupildb (corebird:19997): corebird-DEBUG: 0 Starting stream for goupildb (corebird:19997): corebird-DEBUG: Account.vala:505: Add 0 disabled_rts ids (corebird:19997): corebird-DEBUG: Account.vala:474: Add 0 blocked ids (corebird:19997): corebird-DEBUG: Account.vala:443: Add 0 muted ids (corebird:19997): corebird-DEBUG: Account.vala:399: Adding 11 friends... (corebird:19997): corebird-DEBUG: ComposeTweetWindow.vala:314: Loading /mnt/DDprc/Download/Warsow.jpg (corebird:19997): corebird-DEBUG: CbComposeJob.c:313: POST 1.1/media/upload.json (corebird:19997): corebird-DEBUG: ComposeTweetWindow.vala:100: /mnt/DDprc/Download/Warsow.jpg Finished! (corebird:19997): corebird-DEBUG: CbComposeJob.c:399: POST 1.1/statuses/update.json?media_ids=-1328099328&status=test&auto_populate_reply_metadata=true

(corebird:19997): corebird-WARNING **: Could not send tweet: Bad Request

(corebird:19997): corebird-WARNING **: ComposeTweetWindow.vala:248: Bad Request (corebird:19997): corebird-DEBUG: ComposeTweetWindow.vala:250: Tweet sent.

The result is the same : no tweet sent

Vistaus commented 6 years ago

Okay, so we ruled that out. Do you have the correct permissions set on /mnt/DDprc ? 'Cause if you don't have the correct permissions set, Corebird may not be able to send it because you aren't allowed to.

goupildb commented 6 years ago

Yes I just checked again : i am the owner of the complete path (/mnt/, /mnt/DDprc/, /mnt/DDprc/Download/)

Vistaus commented 6 years ago

Alright, back to square one then. Let's see if baedert has any more clues :)

goupildb commented 6 years ago

The same test with Corebird 1.5.1 (it works fine) :

$ G_MESSAGES_DEBUG=corebird corebird (corebird:20622): corebird-DEBUG: Corebird.vala:203: startup

(corebird:20622): Gtk-WARNING **: Theme parsing error: style.css:20:13: The 'icon-shadow' property has been renamed to '-gtk-icon-shadow'

(corebird:20622): Gtk-WARNING **: Theme parsing error: style.css:240:16: The 'outline-radius' property has been renamed to '-gtk-outline-radius'

(corebird:20622): Gtk-WARNING **: Theme parsing error: style.css:246:19: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:20622): Gtk-WARNING **: Theme parsing error: style.css:247:25: The :insensitive pseudo-class is deprecated. Use :disabled instead.

(corebird:20622): Gtk-WARNING **: Theme parsing error: style.css:252:36: The :insensitive pseudo-class is deprecated. Use :disabled instead. (corebird:20622): corebird-DEBUG: UserStream.vala:85: CREATING USER STREAM FOR goupildb (corebird:20622): corebird-DEBUG: UserStream.vala:130: Starting stream for goupildb (corebird:20622): corebird-DEBUG: TweetUtils.vala:480: REST Call: GET 1.1/users/show.json?user_id=2455258939&skip_status=true& (corebird:20622): corebird-DEBUG: TweetUtils.vala:480: REST Call: GET 1.1/friendships/no_retweets/ids.json (corebird:20622): corebird-DEBUG: TweetUtils.vala:480: REST Call: GET 1.1/blocks/ids.json (corebird:20622): corebird-DEBUG: TweetUtils.vala:480: REST Call: GET 1.1/mutes/users/ids.json (corebird:20622): corebird-DEBUG: TweetUtils.vala:480: REST Call: GET 1.1/statuses/home_timeline.json?count=28&max_id=9223372036854775806&tweet_mode=extended&include_my_retweet=true&contributor_details=true& (corebird:20622): corebird-DEBUG: Account.vala:473: Add 0 blocked ids (corebird:20622): corebird-DEBUG: Account.vala:504: Add 0 disabled_rts ids (corebird:20622): corebird-DEBUG: Account.vala:442: Add 0 muted ids (corebird:20622): corebird-DEBUG: Account.vala:398: Adding 11 friends... (corebird:20622): corebird-DEBUG: ComposeTweetWindow.vala:284: Loading /mnt/DDprc/Download/Warsow.jpg (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: ComposeJob.vala:211: Uploading 1 images first... (corebird:20622): corebird-DEBUG: ComposeJob.vala:129: Starting upload of /mnt/DDprc/Download/Warsow.jpg (0) (corebird:20622): corebird-DEBUG: ComposeJob.vala:142: id for /mnt/DDprc/Download/Warsow.jpg (0): 939435901465366529 (corebird:20622): corebird-DEBUG: ComposeJob.vala:122: Calling the callback... (corebird:20622): corebird-DEBUG: ComposeJob.vala:213: media_ids[0]: 939435901465366529 (corebird:20622): corebird-DEBUG: ComposeJob.vala:180: id param: 939435901465366529 (corebird:20622): corebird-DEBUG: ComposeTweetWindow.vala:217: Tweet sent. (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb) (corebird:20622): corebird-DEBUG: UserStream.vala:238: HEARTBEAT(goupildb)

(the tweet is sent)

baedert commented 6 years ago

The formatting on github doesn't really help but it seems like the media ID you're trying to use is -1328099328. Are you on a 32bit machine?

goupildb commented 6 years ago

yes

baedert commented 6 years ago

That ^ commit should fix it.

goupildb commented 6 years ago

Yes, It Works! Thank you (all the team) very much for your help and for your great work!

goupildb commented 6 years ago

For information purpose, issue closed with this commit : eb501a3