A few comments embedded below.

Gary

On Tuesday, 7 January 2020 17:56:32 UTC+10, KnC Mc wrote:

> Good eye!!! You are quite correct!  My bad again.  I have actually issued 
> a few import commands:
>
> *PYTHONPATH=/var/tmp/weewx4_src/weewx/bin 
> /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf 
> --from=2019-05-20T07:00 --to=2019-05-20T23:59*
>
> *--- just a couple log entries ---*
>
> *Jan  6 21:22:55 www2 journal: wee_import[31892] INFO weewx.manager: Added 
> record 2019-05-20 23:54:48 PDT (1558421688) to database 'weewx.sdb'*
>
> *Jan  6 21:22:55 www2 journal: wee_import[31892] INFO weewx.manager: Added 
> record 2019-05-20 23:54:48 PDT (1558421688) to daily summary in 'weewx.sdb'*
>
> A ton of successful hits, but the html did not update.
> ---
>

OK, those log entries are consistent with the command, no issue here. 

*PYTHONPATH=/var/tmp/weewx4_src/weewx/bin 
> /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf *
>
>
> Success again, but when I ran it a second time I see this:
>
> *Jan  6 21:43:48 www2 journal: wee_import[759] ERROR weewx.manager: Unable 
> to add record 2020-01-06 21:19:48 PST (1578374388) to database 'weewx.sdb': 
> PRIMARY KEY must be unique*
>
>
> which I believe tells me that the records were imported on the first run, 
> but because they exist it can not import them due to the primary key 
> exists, which is probably set to the date stamp?
>

Correct, wee_import will attempt to write an imported record to archive 
whether it exists or not. If a record with that timestamp already exists 
the WeeWX API logs the failure and moves on. Unfortunately wee_import has 
no way of knowing whether the record was successfully added or not hence 
the seemingly vague messages on the console about records processed (not 
saved) and the need to check the log to see what was actually saved. Again 
nothing wrong here.
 

> PYTHONPATH=/var/tmp/weewx4_src/weewx/bin 
> /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf 
> --date=2020-01-05
>
> PYTHONPATH=/var/tmp/weewx4_src/weewx/bin 
> /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf 
> --date=2020-01-04
>
> PYTHONPATH=/var/tmp/weewx4_src/weewx/bin 
> /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf 
> --date=2020-01-03
>
>
> All of these have similar entries telling me Added records and the same 
> fail when running a second time.
>

As explained above. 

I ran '*wee**_database --check'* and '*wee**_reports*' just because I ran 
> those in my cron job before everything broke.  I was thinking one of those 
> updated the html, and png files.
>

I would not bother with wee_database,  it will add nothing here, the checks 
performed check for an old algorithm that was used in an earlier version as 
well as null strings; you will have none of those from this version of 
wee_import.

I thought about it before I ran the commands, and I could have a permission 
> issue on the directory because the cron ran as root, so I logged in as root 
> before issuing the commands.  Might have to go back in and fix some 
> permissions after, but running as root should have resolved any permission 
> issues.  However when I cd to the weewx directory on my web server and 
> issue:
>
> *lynx index.html*
>

Not sure which directory you refer to re your permissions problem but if it 
is to do with wee_reports I would expect you would see some complaints in 
the log if there was a problem. Could be wrong on that though. Moving on, 
what is index.html? A report generated by Cheetah via a skin? What is in 
the report template used to generate index.html?
  

>
> *-----*
>
> 05/20/2019 07:04:57 AM
>
>
>    Current Conditions
>
>    Outside Temperature       57.6°F
>
>    Wind Chill                57.6°F
>
> -----
>
> the previous date is shown in the html.  :(
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/e7a280a9-e9f6-4d4a-a1b9-5734c1c9b1fe%40googlegroups.com.

Reply via email to