Python script not running correctly when launched with crontab












3















I'm running a telegram bot on my Raspberry Pi 3. When I run it in my console or using Thonny, everything runs smoothly.



python3 /home/pi/Documents/telegrambot.py


The problem occurs when I set the program to start on boot.



sudo crontab -e
[last line] @reboot sudo python3 /home/pi/Documents/telegrambot.py &


I know that the code is running because I set the bot to send me "I'm online" and it answer me if the reply isn't related to sending images... but when I send to it /tempgraph, it should answer with the the picture of its readings.
But I only get the sensor's name and no image at all.



...
chatHist = readCommandHistory(db,chat_id,1)
lastCommand = chatHist[0]['msg']
choice = command.split(".")
if command in lastCommand and len(choice) <= 2:
Fonte = re.search('(s|n)'+str(command.split('.')[0])+')s(.*)', lastCommand).group(2)
bot.sendMessage(chat_id, Fonte) #this works
if len(choice) == 1:
table = sdc.readTableServer(db, senstable, 'Fonte', Fonte)
for sensor in table.Sensor.unique():
bot.sendMessage(chat_id, sensor)
tbl = table[table.Sensor == sensor]
#until here everything is ok
for ts in tiposensores:
try:
gop.plotSetup(tbl[['Data',ts]])
#save the image in the folter ... Images/Imagem.png,
#but only works when not on stratup...
bot.sendPhoto(chat_id,open('/home/pi/Documents/Images/Imagem.png','rb'))
pif.cleanImages()
except OSError:
pass


...



@edit:



I found out that the problem happens after i call



gop.plotSetup(tbl[['Data',ts]]) 


inside the plotSetup function, in this step:



f= plt.figure(figsize=(12, 9))


This is the first time that i use the variable f inside the function.



@edit2



As I said before, the error happens in the plt.figure.



THis is the gpo.plotSetup(), with some changes to catch the error as instructed:



def plotSetup(Data):
...[some code here]...
with open("/home/pi/Desktop/log.csv","a+") as o:
fop.writeCSVFile(o, ['before first plt.figure'])

try:
f= plt.figure(figsize=(12, 9))
except IOError as e:
fop.writeCSVFile(o, e)
except:
for e in sys.exc_info():
fop.writeCSVFile(o, e)

...[some code here]...
f.savefig("/home/pi/Documents/Images/Imagem.png", bbox_inches="tight")


and i got this errors:



<class '_tkinter.TclError'>
no display name and no $DISPLAY environment variable
<traceback object at 0x6e3c8d50>


@edit3



That error led me to this post:



_tkinter.TclError: no display name and no $DISPLAY environment variable



this post suggested use this in the very beginning of the code:



import matplotlib
matplotlib.use('Agg')


and then VOILA!! It's alive.



Really appreciate all the help that you guys gave me, thanks! ;p









share









New contributor




SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Does this gop.PlotSetup generate a picture and store it on disk?

    – Mark Smith
    yesterday











  • Edit the crontab without "sudo": $ crontab -e

    – Benyamin Jafari
    yesterday













  • @MarkSmith, yeah it does! I'll add the last line of this function in the post.

    – SWoto
    yesterday











  • @BenyaminJafari, tried this too, everything runs in the same way as before (sending pictures still not working) =(

    – SWoto
    yesterday











  • Debug the python script to a log file and check the errors after booting. Make sure you use chmod -R, recursive.

    – Pedro Lobito
    yesterday


















3















I'm running a telegram bot on my Raspberry Pi 3. When I run it in my console or using Thonny, everything runs smoothly.



python3 /home/pi/Documents/telegrambot.py


The problem occurs when I set the program to start on boot.



sudo crontab -e
[last line] @reboot sudo python3 /home/pi/Documents/telegrambot.py &


I know that the code is running because I set the bot to send me "I'm online" and it answer me if the reply isn't related to sending images... but when I send to it /tempgraph, it should answer with the the picture of its readings.
But I only get the sensor's name and no image at all.



...
chatHist = readCommandHistory(db,chat_id,1)
lastCommand = chatHist[0]['msg']
choice = command.split(".")
if command in lastCommand and len(choice) <= 2:
Fonte = re.search('(s|n)'+str(command.split('.')[0])+')s(.*)', lastCommand).group(2)
bot.sendMessage(chat_id, Fonte) #this works
if len(choice) == 1:
table = sdc.readTableServer(db, senstable, 'Fonte', Fonte)
for sensor in table.Sensor.unique():
bot.sendMessage(chat_id, sensor)
tbl = table[table.Sensor == sensor]
#until here everything is ok
for ts in tiposensores:
try:
gop.plotSetup(tbl[['Data',ts]])
#save the image in the folter ... Images/Imagem.png,
#but only works when not on stratup...
bot.sendPhoto(chat_id,open('/home/pi/Documents/Images/Imagem.png','rb'))
pif.cleanImages()
except OSError:
pass


...



@edit:



I found out that the problem happens after i call



gop.plotSetup(tbl[['Data',ts]]) 


inside the plotSetup function, in this step:



f= plt.figure(figsize=(12, 9))


This is the first time that i use the variable f inside the function.



@edit2



As I said before, the error happens in the plt.figure.



THis is the gpo.plotSetup(), with some changes to catch the error as instructed:



def plotSetup(Data):
...[some code here]...
with open("/home/pi/Desktop/log.csv","a+") as o:
fop.writeCSVFile(o, ['before first plt.figure'])

try:
f= plt.figure(figsize=(12, 9))
except IOError as e:
fop.writeCSVFile(o, e)
except:
for e in sys.exc_info():
fop.writeCSVFile(o, e)

...[some code here]...
f.savefig("/home/pi/Documents/Images/Imagem.png", bbox_inches="tight")


and i got this errors:



<class '_tkinter.TclError'>
no display name and no $DISPLAY environment variable
<traceback object at 0x6e3c8d50>


@edit3



That error led me to this post:



_tkinter.TclError: no display name and no $DISPLAY environment variable



this post suggested use this in the very beginning of the code:



import matplotlib
matplotlib.use('Agg')


and then VOILA!! It's alive.



Really appreciate all the help that you guys gave me, thanks! ;p









share









New contributor




SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Does this gop.PlotSetup generate a picture and store it on disk?

    – Mark Smith
    yesterday











  • Edit the crontab without "sudo": $ crontab -e

    – Benyamin Jafari
    yesterday













  • @MarkSmith, yeah it does! I'll add the last line of this function in the post.

    – SWoto
    yesterday











  • @BenyaminJafari, tried this too, everything runs in the same way as before (sending pictures still not working) =(

    – SWoto
    yesterday











  • Debug the python script to a log file and check the errors after booting. Make sure you use chmod -R, recursive.

    – Pedro Lobito
    yesterday
















3












3








3


1






I'm running a telegram bot on my Raspberry Pi 3. When I run it in my console or using Thonny, everything runs smoothly.



python3 /home/pi/Documents/telegrambot.py


The problem occurs when I set the program to start on boot.



sudo crontab -e
[last line] @reboot sudo python3 /home/pi/Documents/telegrambot.py &


I know that the code is running because I set the bot to send me "I'm online" and it answer me if the reply isn't related to sending images... but when I send to it /tempgraph, it should answer with the the picture of its readings.
But I only get the sensor's name and no image at all.



...
chatHist = readCommandHistory(db,chat_id,1)
lastCommand = chatHist[0]['msg']
choice = command.split(".")
if command in lastCommand and len(choice) <= 2:
Fonte = re.search('(s|n)'+str(command.split('.')[0])+')s(.*)', lastCommand).group(2)
bot.sendMessage(chat_id, Fonte) #this works
if len(choice) == 1:
table = sdc.readTableServer(db, senstable, 'Fonte', Fonte)
for sensor in table.Sensor.unique():
bot.sendMessage(chat_id, sensor)
tbl = table[table.Sensor == sensor]
#until here everything is ok
for ts in tiposensores:
try:
gop.plotSetup(tbl[['Data',ts]])
#save the image in the folter ... Images/Imagem.png,
#but only works when not on stratup...
bot.sendPhoto(chat_id,open('/home/pi/Documents/Images/Imagem.png','rb'))
pif.cleanImages()
except OSError:
pass


...



@edit:



I found out that the problem happens after i call



gop.plotSetup(tbl[['Data',ts]]) 


inside the plotSetup function, in this step:



f= plt.figure(figsize=(12, 9))


This is the first time that i use the variable f inside the function.



@edit2



As I said before, the error happens in the plt.figure.



THis is the gpo.plotSetup(), with some changes to catch the error as instructed:



def plotSetup(Data):
...[some code here]...
with open("/home/pi/Desktop/log.csv","a+") as o:
fop.writeCSVFile(o, ['before first plt.figure'])

try:
f= plt.figure(figsize=(12, 9))
except IOError as e:
fop.writeCSVFile(o, e)
except:
for e in sys.exc_info():
fop.writeCSVFile(o, e)

...[some code here]...
f.savefig("/home/pi/Documents/Images/Imagem.png", bbox_inches="tight")


and i got this errors:



<class '_tkinter.TclError'>
no display name and no $DISPLAY environment variable
<traceback object at 0x6e3c8d50>


@edit3



That error led me to this post:



_tkinter.TclError: no display name and no $DISPLAY environment variable



this post suggested use this in the very beginning of the code:



import matplotlib
matplotlib.use('Agg')


and then VOILA!! It's alive.



Really appreciate all the help that you guys gave me, thanks! ;p









share









New contributor




SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm running a telegram bot on my Raspberry Pi 3. When I run it in my console or using Thonny, everything runs smoothly.



python3 /home/pi/Documents/telegrambot.py


The problem occurs when I set the program to start on boot.



sudo crontab -e
[last line] @reboot sudo python3 /home/pi/Documents/telegrambot.py &


I know that the code is running because I set the bot to send me "I'm online" and it answer me if the reply isn't related to sending images... but when I send to it /tempgraph, it should answer with the the picture of its readings.
But I only get the sensor's name and no image at all.



...
chatHist = readCommandHistory(db,chat_id,1)
lastCommand = chatHist[0]['msg']
choice = command.split(".")
if command in lastCommand and len(choice) <= 2:
Fonte = re.search('(s|n)'+str(command.split('.')[0])+')s(.*)', lastCommand).group(2)
bot.sendMessage(chat_id, Fonte) #this works
if len(choice) == 1:
table = sdc.readTableServer(db, senstable, 'Fonte', Fonte)
for sensor in table.Sensor.unique():
bot.sendMessage(chat_id, sensor)
tbl = table[table.Sensor == sensor]
#until here everything is ok
for ts in tiposensores:
try:
gop.plotSetup(tbl[['Data',ts]])
#save the image in the folter ... Images/Imagem.png,
#but only works when not on stratup...
bot.sendPhoto(chat_id,open('/home/pi/Documents/Images/Imagem.png','rb'))
pif.cleanImages()
except OSError:
pass


...



@edit:



I found out that the problem happens after i call



gop.plotSetup(tbl[['Data',ts]]) 


inside the plotSetup function, in this step:



f= plt.figure(figsize=(12, 9))


This is the first time that i use the variable f inside the function.



@edit2



As I said before, the error happens in the plt.figure.



THis is the gpo.plotSetup(), with some changes to catch the error as instructed:



def plotSetup(Data):
...[some code here]...
with open("/home/pi/Desktop/log.csv","a+") as o:
fop.writeCSVFile(o, ['before first plt.figure'])

try:
f= plt.figure(figsize=(12, 9))
except IOError as e:
fop.writeCSVFile(o, e)
except:
for e in sys.exc_info():
fop.writeCSVFile(o, e)

...[some code here]...
f.savefig("/home/pi/Documents/Images/Imagem.png", bbox_inches="tight")


and i got this errors:



<class '_tkinter.TclError'>
no display name and no $DISPLAY environment variable
<traceback object at 0x6e3c8d50>


@edit3



That error led me to this post:



_tkinter.TclError: no display name and no $DISPLAY environment variable



this post suggested use this in the very beginning of the code:



import matplotlib
matplotlib.use('Agg')


and then VOILA!! It's alive.



Really appreciate all the help that you guys gave me, thanks! ;p







raspbian pi-3 python boot





share









New contributor




SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share









New contributor




SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share



share








edited 4 hours ago







SWoto













New contributor




SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









SWotoSWoto

192




192




New contributor




SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Does this gop.PlotSetup generate a picture and store it on disk?

    – Mark Smith
    yesterday











  • Edit the crontab without "sudo": $ crontab -e

    – Benyamin Jafari
    yesterday













  • @MarkSmith, yeah it does! I'll add the last line of this function in the post.

    – SWoto
    yesterday











  • @BenyaminJafari, tried this too, everything runs in the same way as before (sending pictures still not working) =(

    – SWoto
    yesterday











  • Debug the python script to a log file and check the errors after booting. Make sure you use chmod -R, recursive.

    – Pedro Lobito
    yesterday





















  • Does this gop.PlotSetup generate a picture and store it on disk?

    – Mark Smith
    yesterday











  • Edit the crontab without "sudo": $ crontab -e

    – Benyamin Jafari
    yesterday













  • @MarkSmith, yeah it does! I'll add the last line of this function in the post.

    – SWoto
    yesterday











  • @BenyaminJafari, tried this too, everything runs in the same way as before (sending pictures still not working) =(

    – SWoto
    yesterday











  • Debug the python script to a log file and check the errors after booting. Make sure you use chmod -R, recursive.

    – Pedro Lobito
    yesterday



















Does this gop.PlotSetup generate a picture and store it on disk?

– Mark Smith
yesterday





Does this gop.PlotSetup generate a picture and store it on disk?

– Mark Smith
yesterday













Edit the crontab without "sudo": $ crontab -e

– Benyamin Jafari
yesterday







Edit the crontab without "sudo": $ crontab -e

– Benyamin Jafari
yesterday















@MarkSmith, yeah it does! I'll add the last line of this function in the post.

– SWoto
yesterday





@MarkSmith, yeah it does! I'll add the last line of this function in the post.

– SWoto
yesterday













@BenyaminJafari, tried this too, everything runs in the same way as before (sending pictures still not working) =(

– SWoto
yesterday





@BenyaminJafari, tried this too, everything runs in the same way as before (sending pictures still not working) =(

– SWoto
yesterday













Debug the python script to a log file and check the errors after booting. Make sure you use chmod -R, recursive.

– Pedro Lobito
yesterday







Debug the python script to a log file and check the errors after booting. Make sure you use chmod -R, recursive.

– Pedro Lobito
yesterday












4 Answers
4






active

oldest

votes


















2














Try this:



$ sudo chmod 777 /home/pi/Documents/Images 


After you've done that, re-boot to check if that fixes it.

If not, try changing your crontab entry to this:



@reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1)


You should also consider adding a debug statement to your Python code to collect and save any errors that are thrown during execution.






share|improve this answer


























  • I thied this with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

    – SWoto
    yesterday













  • @SWoto: I'll edit my answer; check back shortly. In the meantime, what is the purpose of the stuff on your crontab: [Ctrl+X -> Y -> Enter] ?

    – Seamus
    yesterday











  • @Seamnu: i tried what u said and it didn't solve the problem. But i've some more info (i'll add it in the post too). The problem happens inside this funciton: gop.plotSetup(tbl[['Data',ts]]), right here f= plt.figure(figsize=(12, 9)). This is the first time using the variable 'f' and plt comes from import matplotlib.pyplot as plt. So the problem lies in the plt, not in the folter permission, because the saving step is the last thing inside the plotSetup function.

    – SWoto
    yesterday





















2














You have two problems: the problem of the file not being found, and the problem preventing you from debugging the first problem.



First let's make a general improvement. You have



try:
[...]
except OSError e:
pass


This means if the try part fails with OSError, it will just ignore it, tell you nothing about it, and carry on. At very least, log the error:



try:
[...]
except OSError e:
print(e)


Now when it goes wrong you should be able to find out why from the system logs (/var/log/syslog I think).



Now the real problem. I don't know what this gop thing is, and your extract doesn't show it, but you say it generates a file, which you indicate is in Images/Imagem.png -- although I suspect it's really in Documents/Images/Imagem.png. This is a relative path - relative to your current directory. When you load the file in the next line, you use an absolute path - relative to the filesystem root.



When you run the file as user pi you are probably doing so from /home/pi (or ~pi, which is equivalent), your file goes into /home/pi/Documents/Images/Imagem.png, the absolute and relative paths happen to match up, and the next line can find the file. However when you run it from crontab, it will have a different current directory. I don't know offhand what current directory crontab will give it, but there's no way it'll be /home/pi.



Either change gop (whatever that is) to put the file in an absolute location (I don't have the code to help with that), or change your code to read it from the same relative location:



bot.sendPhoto(chat_id,open('Documents/Images/Imagem.png','rb'))


Lastly, unless there is a good reason to run the script as root, don't. It should have the least privilege it requires to work. Just good practice.






share|improve this answer































    1














    This might be a permission problem. When running under the user's (your) credentials it works and when under the crontab's credentials is does not.



    Try a test: WRT to your images, temporarily open permissions to all images files and the associated directory and see if the application works when run by the crontab.



    Don't leave the permissions opened to all as it is a security risk.






    share|improve this answer
























    • I thied this ($ sudo chmod 777 /home/pi/Documents/Images ) with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

      – SWoto
      yesterday











    • There may also be an issue with the path you use and the path which is used when running a crontab job. But since you indicated the python script was running I didn't mention it. Also, use complete paths to files avoiding problems associated with variables like "$HOME" or paths which start with "~".

      – st2000
      yesterday











    • just eddited the post. I found that the problem lies here: f= plt.figure(figsize=(12, 9)), inside the plotSetup function. I tried the complete paths too, like u and Seamus said: reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1), but the problem persists.

      – SWoto
      yesterday



















    1














    like i said in the last edition that i made in the question...



    After adding the print sentence to some file after the exception, i got this:



    <class '_tkinter.TclError'>
    no display name and no $DISPLAY environment variable
    <traceback object at 0x6e3c8d50>


    Thit error led me to this post:



    _tkinter.TclError: no display name and no $DISPLAY environment variable



    that suggested to use this in the very beginning of the code:



    import matplotlib
    matplotlib.use('Agg')


    and then VOILA!! It's alive.



    Really appreciate all the help that you guys gave me, thanks @Seamus, @Mark Smith and @st2000!! ;p






    share|improve this answer








    New contributor




    SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer






      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("schematics", function () {
      StackExchange.schematics.init();
      });
      }, "cicuitlab");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "447"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      SWoto is a new contributor. Be nice, and check out our Code of Conduct.










      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f95726%2fpython-script-not-running-correctly-when-launched-with-crontab%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      Try this:



      $ sudo chmod 777 /home/pi/Documents/Images 


      After you've done that, re-boot to check if that fixes it.

      If not, try changing your crontab entry to this:



      @reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1)


      You should also consider adding a debug statement to your Python code to collect and save any errors that are thrown during execution.






      share|improve this answer


























      • I thied this with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

        – SWoto
        yesterday













      • @SWoto: I'll edit my answer; check back shortly. In the meantime, what is the purpose of the stuff on your crontab: [Ctrl+X -> Y -> Enter] ?

        – Seamus
        yesterday











      • @Seamnu: i tried what u said and it didn't solve the problem. But i've some more info (i'll add it in the post too). The problem happens inside this funciton: gop.plotSetup(tbl[['Data',ts]]), right here f= plt.figure(figsize=(12, 9)). This is the first time using the variable 'f' and plt comes from import matplotlib.pyplot as plt. So the problem lies in the plt, not in the folter permission, because the saving step is the last thing inside the plotSetup function.

        – SWoto
        yesterday


















      2














      Try this:



      $ sudo chmod 777 /home/pi/Documents/Images 


      After you've done that, re-boot to check if that fixes it.

      If not, try changing your crontab entry to this:



      @reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1)


      You should also consider adding a debug statement to your Python code to collect and save any errors that are thrown during execution.






      share|improve this answer


























      • I thied this with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

        – SWoto
        yesterday













      • @SWoto: I'll edit my answer; check back shortly. In the meantime, what is the purpose of the stuff on your crontab: [Ctrl+X -> Y -> Enter] ?

        – Seamus
        yesterday











      • @Seamnu: i tried what u said and it didn't solve the problem. But i've some more info (i'll add it in the post too). The problem happens inside this funciton: gop.plotSetup(tbl[['Data',ts]]), right here f= plt.figure(figsize=(12, 9)). This is the first time using the variable 'f' and plt comes from import matplotlib.pyplot as plt. So the problem lies in the plt, not in the folter permission, because the saving step is the last thing inside the plotSetup function.

        – SWoto
        yesterday
















      2












      2








      2







      Try this:



      $ sudo chmod 777 /home/pi/Documents/Images 


      After you've done that, re-boot to check if that fixes it.

      If not, try changing your crontab entry to this:



      @reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1)


      You should also consider adding a debug statement to your Python code to collect and save any errors that are thrown during execution.






      share|improve this answer















      Try this:



      $ sudo chmod 777 /home/pi/Documents/Images 


      After you've done that, re-boot to check if that fixes it.

      If not, try changing your crontab entry to this:



      @reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1)


      You should also consider adding a debug statement to your Python code to collect and save any errors that are thrown during execution.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited yesterday

























      answered yesterday









      SeamusSeamus

      2,8071321




      2,8071321













      • I thied this with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

        – SWoto
        yesterday













      • @SWoto: I'll edit my answer; check back shortly. In the meantime, what is the purpose of the stuff on your crontab: [Ctrl+X -> Y -> Enter] ?

        – Seamus
        yesterday











      • @Seamnu: i tried what u said and it didn't solve the problem. But i've some more info (i'll add it in the post too). The problem happens inside this funciton: gop.plotSetup(tbl[['Data',ts]]), right here f= plt.figure(figsize=(12, 9)). This is the first time using the variable 'f' and plt comes from import matplotlib.pyplot as plt. So the problem lies in the plt, not in the folter permission, because the saving step is the last thing inside the plotSetup function.

        – SWoto
        yesterday





















      • I thied this with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

        – SWoto
        yesterday













      • @SWoto: I'll edit my answer; check back shortly. In the meantime, what is the purpose of the stuff on your crontab: [Ctrl+X -> Y -> Enter] ?

        – Seamus
        yesterday











      • @Seamnu: i tried what u said and it didn't solve the problem. But i've some more info (i'll add it in the post too). The problem happens inside this funciton: gop.plotSetup(tbl[['Data',ts]]), right here f= plt.figure(figsize=(12, 9)). This is the first time using the variable 'f' and plt comes from import matplotlib.pyplot as plt. So the problem lies in the plt, not in the folter permission, because the saving step is the last thing inside the plotSetup function.

        – SWoto
        yesterday



















      I thied this with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

      – SWoto
      yesterday







      I thied this with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

      – SWoto
      yesterday















      @SWoto: I'll edit my answer; check back shortly. In the meantime, what is the purpose of the stuff on your crontab: [Ctrl+X -> Y -> Enter] ?

      – Seamus
      yesterday





      @SWoto: I'll edit my answer; check back shortly. In the meantime, what is the purpose of the stuff on your crontab: [Ctrl+X -> Y -> Enter] ?

      – Seamus
      yesterday













      @Seamnu: i tried what u said and it didn't solve the problem. But i've some more info (i'll add it in the post too). The problem happens inside this funciton: gop.plotSetup(tbl[['Data',ts]]), right here f= plt.figure(figsize=(12, 9)). This is the first time using the variable 'f' and plt comes from import matplotlib.pyplot as plt. So the problem lies in the plt, not in the folter permission, because the saving step is the last thing inside the plotSetup function.

      – SWoto
      yesterday







      @Seamnu: i tried what u said and it didn't solve the problem. But i've some more info (i'll add it in the post too). The problem happens inside this funciton: gop.plotSetup(tbl[['Data',ts]]), right here f= plt.figure(figsize=(12, 9)). This is the first time using the variable 'f' and plt comes from import matplotlib.pyplot as plt. So the problem lies in the plt, not in the folter permission, because the saving step is the last thing inside the plotSetup function.

      – SWoto
      yesterday















      2














      You have two problems: the problem of the file not being found, and the problem preventing you from debugging the first problem.



      First let's make a general improvement. You have



      try:
      [...]
      except OSError e:
      pass


      This means if the try part fails with OSError, it will just ignore it, tell you nothing about it, and carry on. At very least, log the error:



      try:
      [...]
      except OSError e:
      print(e)


      Now when it goes wrong you should be able to find out why from the system logs (/var/log/syslog I think).



      Now the real problem. I don't know what this gop thing is, and your extract doesn't show it, but you say it generates a file, which you indicate is in Images/Imagem.png -- although I suspect it's really in Documents/Images/Imagem.png. This is a relative path - relative to your current directory. When you load the file in the next line, you use an absolute path - relative to the filesystem root.



      When you run the file as user pi you are probably doing so from /home/pi (or ~pi, which is equivalent), your file goes into /home/pi/Documents/Images/Imagem.png, the absolute and relative paths happen to match up, and the next line can find the file. However when you run it from crontab, it will have a different current directory. I don't know offhand what current directory crontab will give it, but there's no way it'll be /home/pi.



      Either change gop (whatever that is) to put the file in an absolute location (I don't have the code to help with that), or change your code to read it from the same relative location:



      bot.sendPhoto(chat_id,open('Documents/Images/Imagem.png','rb'))


      Lastly, unless there is a good reason to run the script as root, don't. It should have the least privilege it requires to work. Just good practice.






      share|improve this answer




























        2














        You have two problems: the problem of the file not being found, and the problem preventing you from debugging the first problem.



        First let's make a general improvement. You have



        try:
        [...]
        except OSError e:
        pass


        This means if the try part fails with OSError, it will just ignore it, tell you nothing about it, and carry on. At very least, log the error:



        try:
        [...]
        except OSError e:
        print(e)


        Now when it goes wrong you should be able to find out why from the system logs (/var/log/syslog I think).



        Now the real problem. I don't know what this gop thing is, and your extract doesn't show it, but you say it generates a file, which you indicate is in Images/Imagem.png -- although I suspect it's really in Documents/Images/Imagem.png. This is a relative path - relative to your current directory. When you load the file in the next line, you use an absolute path - relative to the filesystem root.



        When you run the file as user pi you are probably doing so from /home/pi (or ~pi, which is equivalent), your file goes into /home/pi/Documents/Images/Imagem.png, the absolute and relative paths happen to match up, and the next line can find the file. However when you run it from crontab, it will have a different current directory. I don't know offhand what current directory crontab will give it, but there's no way it'll be /home/pi.



        Either change gop (whatever that is) to put the file in an absolute location (I don't have the code to help with that), or change your code to read it from the same relative location:



        bot.sendPhoto(chat_id,open('Documents/Images/Imagem.png','rb'))


        Lastly, unless there is a good reason to run the script as root, don't. It should have the least privilege it requires to work. Just good practice.






        share|improve this answer


























          2












          2








          2







          You have two problems: the problem of the file not being found, and the problem preventing you from debugging the first problem.



          First let's make a general improvement. You have



          try:
          [...]
          except OSError e:
          pass


          This means if the try part fails with OSError, it will just ignore it, tell you nothing about it, and carry on. At very least, log the error:



          try:
          [...]
          except OSError e:
          print(e)


          Now when it goes wrong you should be able to find out why from the system logs (/var/log/syslog I think).



          Now the real problem. I don't know what this gop thing is, and your extract doesn't show it, but you say it generates a file, which you indicate is in Images/Imagem.png -- although I suspect it's really in Documents/Images/Imagem.png. This is a relative path - relative to your current directory. When you load the file in the next line, you use an absolute path - relative to the filesystem root.



          When you run the file as user pi you are probably doing so from /home/pi (or ~pi, which is equivalent), your file goes into /home/pi/Documents/Images/Imagem.png, the absolute and relative paths happen to match up, and the next line can find the file. However when you run it from crontab, it will have a different current directory. I don't know offhand what current directory crontab will give it, but there's no way it'll be /home/pi.



          Either change gop (whatever that is) to put the file in an absolute location (I don't have the code to help with that), or change your code to read it from the same relative location:



          bot.sendPhoto(chat_id,open('Documents/Images/Imagem.png','rb'))


          Lastly, unless there is a good reason to run the script as root, don't. It should have the least privilege it requires to work. Just good practice.






          share|improve this answer













          You have two problems: the problem of the file not being found, and the problem preventing you from debugging the first problem.



          First let's make a general improvement. You have



          try:
          [...]
          except OSError e:
          pass


          This means if the try part fails with OSError, it will just ignore it, tell you nothing about it, and carry on. At very least, log the error:



          try:
          [...]
          except OSError e:
          print(e)


          Now when it goes wrong you should be able to find out why from the system logs (/var/log/syslog I think).



          Now the real problem. I don't know what this gop thing is, and your extract doesn't show it, but you say it generates a file, which you indicate is in Images/Imagem.png -- although I suspect it's really in Documents/Images/Imagem.png. This is a relative path - relative to your current directory. When you load the file in the next line, you use an absolute path - relative to the filesystem root.



          When you run the file as user pi you are probably doing so from /home/pi (or ~pi, which is equivalent), your file goes into /home/pi/Documents/Images/Imagem.png, the absolute and relative paths happen to match up, and the next line can find the file. However when you run it from crontab, it will have a different current directory. I don't know offhand what current directory crontab will give it, but there's no way it'll be /home/pi.



          Either change gop (whatever that is) to put the file in an absolute location (I don't have the code to help with that), or change your code to read it from the same relative location:



          bot.sendPhoto(chat_id,open('Documents/Images/Imagem.png','rb'))


          Lastly, unless there is a good reason to run the script as root, don't. It should have the least privilege it requires to work. Just good practice.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 17 hours ago









          Mark SmithMark Smith

          97249




          97249























              1














              This might be a permission problem. When running under the user's (your) credentials it works and when under the crontab's credentials is does not.



              Try a test: WRT to your images, temporarily open permissions to all images files and the associated directory and see if the application works when run by the crontab.



              Don't leave the permissions opened to all as it is a security risk.






              share|improve this answer
























              • I thied this ($ sudo chmod 777 /home/pi/Documents/Images ) with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

                – SWoto
                yesterday











              • There may also be an issue with the path you use and the path which is used when running a crontab job. But since you indicated the python script was running I didn't mention it. Also, use complete paths to files avoiding problems associated with variables like "$HOME" or paths which start with "~".

                – st2000
                yesterday











              • just eddited the post. I found that the problem lies here: f= plt.figure(figsize=(12, 9)), inside the plotSetup function. I tried the complete paths too, like u and Seamus said: reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1), but the problem persists.

                – SWoto
                yesterday
















              1














              This might be a permission problem. When running under the user's (your) credentials it works and when under the crontab's credentials is does not.



              Try a test: WRT to your images, temporarily open permissions to all images files and the associated directory and see if the application works when run by the crontab.



              Don't leave the permissions opened to all as it is a security risk.






              share|improve this answer
























              • I thied this ($ sudo chmod 777 /home/pi/Documents/Images ) with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

                – SWoto
                yesterday











              • There may also be an issue with the path you use and the path which is used when running a crontab job. But since you indicated the python script was running I didn't mention it. Also, use complete paths to files avoiding problems associated with variables like "$HOME" or paths which start with "~".

                – st2000
                yesterday











              • just eddited the post. I found that the problem lies here: f= plt.figure(figsize=(12, 9)), inside the plotSetup function. I tried the complete paths too, like u and Seamus said: reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1), but the problem persists.

                – SWoto
                yesterday














              1












              1








              1







              This might be a permission problem. When running under the user's (your) credentials it works and when under the crontab's credentials is does not.



              Try a test: WRT to your images, temporarily open permissions to all images files and the associated directory and see if the application works when run by the crontab.



              Don't leave the permissions opened to all as it is a security risk.






              share|improve this answer













              This might be a permission problem. When running under the user's (your) credentials it works and when under the crontab's credentials is does not.



              Try a test: WRT to your images, temporarily open permissions to all images files and the associated directory and see if the application works when run by the crontab.



              Don't leave the permissions opened to all as it is a security risk.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered yesterday









              st2000st2000

              36414




              36414













              • I thied this ($ sudo chmod 777 /home/pi/Documents/Images ) with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

                – SWoto
                yesterday











              • There may also be an issue with the path you use and the path which is used when running a crontab job. But since you indicated the python script was running I didn't mention it. Also, use complete paths to files avoiding problems associated with variables like "$HOME" or paths which start with "~".

                – st2000
                yesterday











              • just eddited the post. I found that the problem lies here: f= plt.figure(figsize=(12, 9)), inside the plotSetup function. I tried the complete paths too, like u and Seamus said: reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1), but the problem persists.

                – SWoto
                yesterday



















              • I thied this ($ sudo chmod 777 /home/pi/Documents/Images ) with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

                – SWoto
                yesterday











              • There may also be an issue with the path you use and the path which is used when running a crontab job. But since you indicated the python script was running I didn't mention it. Also, use complete paths to files avoiding problems associated with variables like "$HOME" or paths which start with "~".

                – st2000
                yesterday











              • just eddited the post. I found that the problem lies here: f= plt.figure(figsize=(12, 9)), inside the plotSetup function. I tried the complete paths too, like u and Seamus said: reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1), but the problem persists.

                – SWoto
                yesterday

















              I thied this ($ sudo chmod 777 /home/pi/Documents/Images ) with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

              – SWoto
              yesterday





              I thied this ($ sudo chmod 777 /home/pi/Documents/Images ) with no success. =/. Also changed the crontab code to: @reboot python3 /home/pi/Documents/telegrambot.py & /home/pi/Desktop/log.txt >&1 to get some error log, but nothing happened.

              – SWoto
              yesterday













              There may also be an issue with the path you use and the path which is used when running a crontab job. But since you indicated the python script was running I didn't mention it. Also, use complete paths to files avoiding problems associated with variables like "$HOME" or paths which start with "~".

              – st2000
              yesterday





              There may also be an issue with the path you use and the path which is used when running a crontab job. But since you indicated the python script was running I didn't mention it. Also, use complete paths to files avoiding problems associated with variables like "$HOME" or paths which start with "~".

              – st2000
              yesterday













              just eddited the post. I found that the problem lies here: f= plt.figure(figsize=(12, 9)), inside the plotSetup function. I tried the complete paths too, like u and Seamus said: reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1), but the problem persists.

              – SWoto
              yesterday





              just eddited the post. I found that the problem lies here: f= plt.figure(figsize=(12, 9)), inside the plotSetup function. I tried the complete paths too, like u and Seamus said: reboot ( /bin/sleep 30; /usr/bin/sudo /usr/bin/python3 /home/pi/Documents/telegrambot.py >> /home/pi/Desktop/log.txt 2>&1), but the problem persists.

              – SWoto
              yesterday











              1














              like i said in the last edition that i made in the question...



              After adding the print sentence to some file after the exception, i got this:



              <class '_tkinter.TclError'>
              no display name and no $DISPLAY environment variable
              <traceback object at 0x6e3c8d50>


              Thit error led me to this post:



              _tkinter.TclError: no display name and no $DISPLAY environment variable



              that suggested to use this in the very beginning of the code:



              import matplotlib
              matplotlib.use('Agg')


              and then VOILA!! It's alive.



              Really appreciate all the help that you guys gave me, thanks @Seamus, @Mark Smith and @st2000!! ;p






              share|improve this answer








              New contributor




              SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                1














                like i said in the last edition that i made in the question...



                After adding the print sentence to some file after the exception, i got this:



                <class '_tkinter.TclError'>
                no display name and no $DISPLAY environment variable
                <traceback object at 0x6e3c8d50>


                Thit error led me to this post:



                _tkinter.TclError: no display name and no $DISPLAY environment variable



                that suggested to use this in the very beginning of the code:



                import matplotlib
                matplotlib.use('Agg')


                and then VOILA!! It's alive.



                Really appreciate all the help that you guys gave me, thanks @Seamus, @Mark Smith and @st2000!! ;p






                share|improve this answer








                New contributor




                SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  1












                  1








                  1







                  like i said in the last edition that i made in the question...



                  After adding the print sentence to some file after the exception, i got this:



                  <class '_tkinter.TclError'>
                  no display name and no $DISPLAY environment variable
                  <traceback object at 0x6e3c8d50>


                  Thit error led me to this post:



                  _tkinter.TclError: no display name and no $DISPLAY environment variable



                  that suggested to use this in the very beginning of the code:



                  import matplotlib
                  matplotlib.use('Agg')


                  and then VOILA!! It's alive.



                  Really appreciate all the help that you guys gave me, thanks @Seamus, @Mark Smith and @st2000!! ;p






                  share|improve this answer








                  New contributor




                  SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  like i said in the last edition that i made in the question...



                  After adding the print sentence to some file after the exception, i got this:



                  <class '_tkinter.TclError'>
                  no display name and no $DISPLAY environment variable
                  <traceback object at 0x6e3c8d50>


                  Thit error led me to this post:



                  _tkinter.TclError: no display name and no $DISPLAY environment variable



                  that suggested to use this in the very beginning of the code:



                  import matplotlib
                  matplotlib.use('Agg')


                  and then VOILA!! It's alive.



                  Really appreciate all the help that you guys gave me, thanks @Seamus, @Mark Smith and @st2000!! ;p







                  share|improve this answer








                  New contributor




                  SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 4 hours ago









                  SWotoSWoto

                  111




                  111




                  New contributor




                  SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  SWoto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






















                      SWoto is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      SWoto is a new contributor. Be nice, and check out our Code of Conduct.













                      SWoto is a new contributor. Be nice, and check out our Code of Conduct.












                      SWoto is a new contributor. Be nice, and check out our Code of Conduct.
















                      Thanks for contributing an answer to Raspberry Pi Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f95726%2fpython-script-not-running-correctly-when-launched-with-crontab%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum

                      He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

                      Slayer Innehåll Historia | Stil, komposition och lyrik | Bandets betydelse och framgångar | Sidoprojekt och samarbeten | Kontroverser | Medlemmar | Utmärkelser och nomineringar | Turnéer och festivaler | Diskografi | Referenser | Externa länkar | Navigeringsmenywww.slayer.net”Metal Massacre vol. 1””Metal Massacre vol. 3””Metal Massacre Volume III””Show No Mercy””Haunting the Chapel””Live Undead””Hell Awaits””Reign in Blood””Reign in Blood””Gold & Platinum – Reign in Blood””Golden Gods Awards Winners”originalet”Kerrang! Hall Of Fame””Slayer Looks Back On 37-Year Career In New Video Series: Part Two””South of Heaven””Gold & Platinum – South of Heaven””Seasons in the Abyss””Gold & Platinum - Seasons in the Abyss””Divine Intervention””Divine Intervention - Release group by Slayer””Gold & Platinum - Divine Intervention””Live Intrusion””Undisputed Attitude””Abolish Government/Superficial Love””Release “Slatanic Slaughter: A Tribute to Slayer” by Various Artists””Diabolus in Musica””Soundtrack to the Apocalypse””God Hates Us All””Systematic - Relationships””War at the Warfield””Gold & Platinum - War at the Warfield””Soundtrack to the Apocalypse””Gold & Platinum - Still Reigning””Metallica, Slayer, Iron Mauden Among Winners At Metal Hammer Awards””Eternal Pyre””Eternal Pyre - Slayer release group””Eternal Pyre””Metal Storm Awards 2006””Kerrang! Hall Of Fame””Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Bullet-For My Valentine booed at Metal Hammer Golden Gods Awards””Unholy Aliance””The End Of Slayer?””Slayer: We Could Thrash Out Two More Albums If We're Fast Enough...””'The Unholy Alliance: Chapter III' UK Dates Added”originalet”Megadeth And Slayer To Co-Headline 'Canadian Carnage' Trek”originalet”World Painted Blood””Release “World Painted Blood” by Slayer””Metallica Heading To Cinemas””Slayer, Megadeth To Join Forces For 'European Carnage' Tour - Dec. 18, 2010”originalet”Slayer's Hanneman Contracts Acute Infection; Band To Bring In Guest Guitarist””Cannibal Corpse's Pat O'Brien Will Step In As Slayer's Guest Guitarist”originalet”Slayer’s Jeff Hanneman Dead at 49””Dave Lombardo Says He Made Only $67,000 In 2011 While Touring With Slayer””Slayer: We Do Not Agree With Dave Lombardo's Substance Or Timeline Of Events””Slayer Welcomes Drummer Paul Bostaph Back To The Fold””Slayer Hope to Unveil Never-Before-Heard Jeff Hanneman Material on Next Album””Slayer Debut New Song 'Implode' During Surprise Golden Gods Appearance””Release group Repentless by Slayer””Repentless - Slayer - Credits””Slayer””Metal Storm Awards 2015””Slayer - to release comic book "Repentless #1"””Slayer To Release 'Repentless' 6.66" Vinyl Box Set””BREAKING NEWS: Slayer Announce Farewell Tour””Slayer Recruit Lamb of God, Anthrax, Behemoth + Testament for Final Tour””Slayer lägger ner efter 37 år””Slayer Announces Second North American Leg Of 'Final' Tour””Final World Tour””Slayer Announces Final European Tour With Lamb of God, Anthrax And Obituary””Slayer To Tour Europe With Lamb of God, Anthrax And Obituary””Slayer To Play 'Last French Show Ever' At Next Year's Hellfst””Slayer's Final World Tour Will Extend Into 2019””Death Angel's Rob Cavestany On Slayer's 'Farewell' Tour: 'Some Of Us Could See This Coming'””Testament Has No Plans To Retire Anytime Soon, Says Chuck Billy””Anthrax's Scott Ian On Slayer's 'Farewell' Tour Plans: 'I Was Surprised And I Wasn't Surprised'””Slayer””Slayer's Morbid Schlock””Review/Rock; For Slayer, the Mania Is the Message””Slayer - Biography””Slayer - Reign In Blood”originalet”Dave Lombardo””An exclusive oral history of Slayer”originalet”Exclusive! Interview With Slayer Guitarist Jeff Hanneman”originalet”Thinking Out Loud: Slayer's Kerry King on hair metal, Satan and being polite””Slayer Lyrics””Slayer - Biography””Most influential artists for extreme metal music””Slayer - Reign in Blood””Slayer guitarist Jeff Hanneman dies aged 49””Slatanic Slaughter: A Tribute to Slayer””Gateway to Hell: A Tribute to Slayer””Covered In Blood””Slayer: The Origins of Thrash in San Francisco, CA.””Why They Rule - #6 Slayer”originalet”Guitar World's 100 Greatest Heavy Metal Guitarists Of All Time”originalet”The fans have spoken: Slayer comes out on top in readers' polls”originalet”Tribute to Jeff Hanneman (1964-2013)””Lamb Of God Frontman: We Sound Like A Slayer Rip-Off””BEHEMOTH Frontman Pays Tribute To SLAYER's JEFF HANNEMAN””Slayer, Hatebreed Doing Double Duty On This Year's Ozzfest””System of a Down””Lacuna Coil’s Andrea Ferro Talks Influences, Skateboarding, Band Origins + More””Slayer - Reign in Blood””Into The Lungs of Hell””Slayer rules - en utställning om fans””Slayer and Their Fans Slashed Through a No-Holds-Barred Night at Gas Monkey””Home””Slayer””Gold & Platinum - The Big 4 Live from Sofia, Bulgaria””Exclusive! Interview With Slayer Guitarist Kerry King””2008-02-23: Wiltern, Los Angeles, CA, USA””Slayer's Kerry King To Perform With Megadeth Tonight! - Oct. 21, 2010”originalet”Dave Lombardo - Biography”Slayer Case DismissedArkiveradUltimate Classic Rock: Slayer guitarist Jeff Hanneman dead at 49.”Slayer: "We could never do any thing like Some Kind Of Monster..."””Cannibal Corpse'S Pat O'Brien Will Step In As Slayer'S Guest Guitarist | The Official Slayer Site”originalet”Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Kerrang! Awards 2006 Blog: Kerrang! Hall Of Fame””Kerrang! Awards 2013: Kerrang! Legend”originalet”Metallica, Slayer, Iron Maien Among Winners At Metal Hammer Awards””Metal Hammer Golden Gods Awards””Bullet For My Valentine Booed At Metal Hammer Golden Gods Awards””Metal Storm Awards 2006””Metal Storm Awards 2015””Slayer's Concert History””Slayer - Relationships””Slayer - Releases”Slayers officiella webbplatsSlayer på MusicBrainzOfficiell webbplatsSlayerSlayerr1373445760000 0001 1540 47353068615-5086262726cb13906545x(data)6033143kn20030215029