GithubHelp home page GithubHelp logo

Comments (14)

Chikashi-Kato avatar Chikashi-Kato commented on July 17, 2024 1

@Pyker Thanks again, I just created v1.5.2!

from slacktee.

Chikashi-Kato avatar Chikashi-Kato commented on July 17, 2024

Hi marcelo321,

How did you set up the token? Did you setup a slack app for slacktee? Or using a bot user?
Also, could you check if test/test.sh can work?

from slacktee.

marcelo321 avatar marcelo321 commented on July 17, 2024

Everything else works just fine. echo abc | slacktee.sh sends the message correctly. I am using a bot for the past months using slacktee.sh

Even if I try to send the line that just failed, like copy-pasting it in a echo, it sends it correctly: echo "string whatever | slacktee.sh

But it fails when I do echo "${var}" | slacktee.sh
with this error slacktee.sh: {"ok":false,"error":"invalid_json"}

from slacktee.

marcelo321 avatar marcelo321 commented on July 17, 2024

Oh ok. echo abc | slacktee.sh works, but the test throw me 150 errors. This might be since I updated from a non-supported linux version to last version of ubuntu and everything is failing now haha:

This test posts many messages to your Slack channel?
Are you sure to execute this test? [y/n] :y
-- Setup mode --
/bin/bash: ../slacktee.sh: No such file or directory
-- Buffering (default) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Non buffering (-n/--no-buffering) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Non buffering (--no-buffering) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- File upload (-f) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- File upload (--file) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Title (-t) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Title (--title) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Title with non buffering (-t and -n)
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Title with file (-t and -f)
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Link (-l) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Link (--link) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Link with title (-t and -l) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Channel (-c) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Channel (--channel) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Channel (-c) with # --
/bin/bash: ../slacktee.sh: No such file or directory
-- Channel (-c) with @ (Shouldn't happen anything) --
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Username (-u) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Username (--username) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Icon (-i) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Icon (--icon) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Icon (-i with URL) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Message formatting (-m) with link_names --
/bin/bash: ../slacktee.sh: No such file or directory
-- Message formatting (--message-formatting) with full --
/bin/bash: ../slacktee.sh: No such file or directory
-- Message formatting (-m) with none --
/bin/bash: ../slacktee.sh: No such file or directory
-- Plain text (-p) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Plain text (--plain-text) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Attachment (-a) with no color --
/bin/bash: ../slacktee.sh: No such file or directory
-- Attachment (--attachment) with 'good' --
/bin/bash: ../slacktee.sh: No such file or directory
-- Attachment (--attachment) with color code --
/bin/bash: ../slacktee.sh: No such file or directory
-- Attachment (-a) with long fiels (-e/--field) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Attachment (-a) with short fiels (-s/--short-field) --
/bin/bash: ../slacktee.sh: No such file or directory
-- Attachment (-a) with long and short fields (-e/-s) --
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) without default color --
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (--cond-color) without default color --
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) with default color --
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) with default color defined by config file
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) - Simple match in buffering mode
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) - Simple match in no-buffering mode
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) - Simple match in file mode
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) - Multiple matches in buffering mode
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) - Multiple matches in no-buffering mode
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional Coloring (-o) - Multiple matches in file mode
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional prefix (-d) in buffering mode --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional prefix (--cond-prefix) in buffering mode --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional prefix (-d) in no-buffering mode - Prefix should be added to 2nd line --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional prefix (-d) in file mode --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Conditional prefix (-d) with attachment --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Check exit code : Success 0 --
/bin/bash: ../slacktee.sh: No such file or directory
127
-- Check exit code : Failure 1 --
/bin/bash: ../slacktee.sh: No such file or directory
127
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Suppress the standard output (-q) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
-- Suppress the standard output (--no-output) --
cat: ./test_data.txt: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
/bin/bash: ../slacktee.sh: No such file or directory
Test is done!
root@localhost:~/slacktee# which slacktee.sh 
/usr/local/bin/slacktee.sh
root@localhost:~/slacktee# echo abc | slacktee.sh 
abc

from slacktee.

Chikashi-Kato avatar Chikashi-Kato commented on July 17, 2024

Ah sorry, the test needs to be executed in test directory. ;p

I'm glad to hear slacktee.sh worked with echo. So it sounds like there are some special characters in your file/${var} that slacktee cannot handle. Is it possible to scrub sensitive data from your file/${var} and share it with me?

from slacktee.

marcelo321 avatar marcelo321 commented on July 17, 2024

so I am redirecting the output of a tool to a file tool > file.

If I do cat file | slacktee.sh it throws me slacktee.sh: {"ok":false,"error":"invalid_json"}.

If I do cat file, then manually copy the output of file to file2.

and then try cat file2 | slacktee.sh I get no errors..

If I do cat file it shows them without empty lines, but doing nano file shows the file as:

line1

line2

line3

maybe newlines or something like that?

from slacktee.

marcelo321 avatar marcelo321 commented on July 17, 2024

Ok so I edited it with vim this time, and apparently there was ^M at the start of every line, removing that allowed me to send the message sucesfully? with nano I couldn't see that

from slacktee.

Chikashi-Kato avatar Chikashi-Kato commented on July 17, 2024

According to this slack overflow thread, ^M is the representation of carriage return in Vim.
That might mess up the json structure of the request. Very interesting.

from slacktee.

marcelo321 avatar marcelo321 commented on July 17, 2024

I am fixing it by adding | tr -d $'\r'| before slacktee.sh

from slacktee.

Chikashi-Kato avatar Chikashi-Kato commented on July 17, 2024

Sounds great! I'm also adding the logic filtering it up to slacktee.sh.

from slacktee.

Chikashi-Kato avatar Chikashi-Kato commented on July 17, 2024

This issue has been fixed by v1.5.1

from slacktee.

Pyker avatar Pyker commented on July 17, 2024

Not sure what happened there, but the mentioned PR was never merged. The only difference between 1.5.0 and 1.5.1 is the README

from slacktee.

Chikashi-Kato avatar Chikashi-Kato commented on July 17, 2024

@Pyker Thank you so much for pointing it out! My bad, I forgot to merge the PR ;( Let me fix it now!

from slacktee.

Pyker avatar Pyker commented on July 17, 2024

You're very welcome! Thanks for the fix.

from slacktee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.