当我在heroku服务器上执行推送机器人时,警告和错误应用程序

2024-09-28 22:21:25 发布

您现在位置:Python中文网/ 问答频道 /正文

当我在heroku服务器上执行push bot时,会出现警告和错误

下面是日志显示的内容

2019-10-27T19:33:44.763662+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2019-10-27T19:33:50.935797+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 
2019-10-27T19:33:51.80547+00:00 app[web.1]: Oct 27, 2019 7:33:51 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:51.805487+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPSMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:51.876766+00:00 app[web.1]: Oct 27, 2019 7:33:51 PM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider loadDiskCache
2019-10-27T19:33:51.87677+00:00 app[web.1]: WARNING: New fonts found, font cache will be re-built
2019-10-27T19:33:51.877867+00:00 app[web.1]: Oct 27, 2019 7:33:51 PM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider <init>
2019-10-27T19:33:51.87787+00:00 app[web.1]: WARNING: Building on-disk font cache, this may take a while
2019-10-27T19:33:52.20161+00:00 app[web.1]: Oct 27, 2019 7:33:52 PM org.apache.pdfbox.pdmodel.font.FileSystemFontProvider <init>
2019-10-27T19:33:52.201628+00:00 app[web.1]: WARNING: Finished building on-disk font cache, found 41 fonts
2019-10-27T19:33:52.204252+00:00 app[web.1]: Oct 27, 2019 7:33:52 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:52.204254+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
2019-10-27T19:33:52.257011+00:00 app[web.1]: Oct 27, 2019 7:33:52 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:52.257014+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPS-BoldMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:52.25878+00:00 app[web.1]: Oct 27, 2019 7:33:52 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:52.258782+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
2019-10-27T19:33:53.304009+00:00 app[web.1]: Oct 27, 2019 7:33:53 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:53.304013+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPS-BoldMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:53.320963+00:00 app[web.1]: Oct 27, 2019 7:33:53 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:53.320966+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
2019-10-27T19:33:53.340814+00:00 app[web.1]: Oct 27, 2019 7:33:53 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:53.340817+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
2019-10-27T19:33:54.03996+00:00 app[web.1]: Oct 27, 2019 7:33:54 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:54.039986+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPS-BoldMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:54.040756+00:00 app[web.1]: Oct 27, 2019 7:33:54 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:54.040759+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
2019-10-27T19:33:54.043011+00:00 app[web.1]: Oct 27, 2019 7:33:54 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:54.043013+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
2019-10-27T19:33:54.738492+00:00 app[web.1]: Oct 27, 2019 7:33:54 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:54.738503+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPS-BoldMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:54.741057+00:00 app[web.1]: Oct 27, 2019 7:33:54 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:54.74106+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
2019-10-27T19:33:54.748425+00:00 app[web.1]: Oct 27, 2019 7:33:54 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:54.748427+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
2019-10-27T19:33:55.217065+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:55.217085+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPS-BoldMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:55.21789+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:55.217892+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
2019-10-27T19:33:55.219662+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:55.219664+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
2019-10-27T19:33:55.576003+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:55.576014+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPS-BoldMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:55.57859+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:55.578592+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
2019-10-27T19:33:55.585985+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:55.585987+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
2019-10-27T19:33:55.767353+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2 <init>
2019-10-27T19:33:55.767356+00:00 app[web.1]: INFO: OpenType Layout tables used in font TimesNewRomanPS-BoldMT are not implemented in PDFBox and will be ignored
2019-10-27T19:33:55.768286+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:55.768288+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPS-BoldMT'
2019-10-27T19:33:55.770978+00:00 app[web.1]: Oct 27, 2019 7:33:55 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
2019-10-27T19:33:55.770981+00:00 app[web.1]: WARNING: Using fallback font 'LiberationSans' for 'TimesNewRomanPSMT'
2019-10-27T19:35:13.152581+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2019-10-27T19:35:13.177756+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-10-27T19:35:13.258681+00:00 heroku[web.1]: Process exited with status 137
2019-10-27T19:35:13.286265+00:00 heroku[web.1]: State changed from starting to crashed

如何解决字体问题

我正在使用表格库阅读pdf

bot应该从pdf文件中读取表

我也使用pom.xml文件你知道吗

python 3.7.4版

我用烧瓶

我的代码:

import telebot
import os
import logging
import output
import timer
import script
import convert
import output
import settings
from time import sleep
from flask import Flask, request

bot = telebot.TeleBot(settings.API_BOT)
day = [1, 1, 2, 3, 4, 5, 6]
i_day = 4
line = 1


def file():
    global i_day
    global line
    script.SearchAndDownloadFile()
    convert.ConvertDocToPdf()
    output.Start()
    if day == 6:
        i_day = 0
        if line == 1:
            line += 1
        else:
            line -= 1
    i_day += 1


rt = timer.RepeatedTimer(43200, file())
try:
    sleep(10000)
finally:
    rt.stop()


server = Flask(__name__)


@bot.message_handler(commands=['start'])
def start_message(message):
    bot.send_message(
        message.chat.id, 'Привет ты написал мне /start , напиши и отправь название своей группы')


@bot.message_handler(content_types=['text'])
def send_text(message):
    if message.text in settings.GROUPS:
        output.Mess(message.text, day, line)
        for i in range(output.LEN):
            bot.send_message(
                message.chat.id, output.OUTPUT_MESS['message' + str(i)]['str_first' + str(i)])
    else:
        bot.send_message(
            message.chat.id, 'Упс, такой группы нет, пропробуй снова')


@server.route("/" + settings.API_BOT, methods=['POST'])
def getMessage():
    bot.process_new_updates(
        [telebot.types.Update.de_json(request.stream.read().decode("utf-8"))])
    return "!", 200


@server.route("/")
def webhook():
    bot.remove_webhook()
    bot.set_webhook(url="https://myapp/" + settings.API_BOT)
    return "?", 200


server.run(host="0.0.0.0", port=int(os.environ.get('PORT', 5000)))

函数文件不应影响速度,因为它将每12小时运行一次。此函数的第一个调用将在启动后12小时内进行 设置。你知道吗

API\u BOT是我的BOT令牌


Tags: inorgappforinitapacheoctpdfbox